SOLVED KVM Guest Cannot Ping TrueNAS SCALE Host (or vice-versa)

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
New Apps either fail to install and get stuck in "deploying" or they install fine and then don't start. They all fail with a "Truenas lookup ix-truenas: no such host" error. Apparently the system doesn't recognize that ix-truenas should redirect to localhost? I had to add ix-truenas to the /etc/hosts file to get the apps to deploy and start. But then I still can't access the web interfaces.
Under Apps | Settings | Advanced Settings

What do you see there? Have you selected the bridge?
 

nullnix

Cadet
Joined
Oct 7, 2014
Messages
4
Under Apps | Settings | Advanced Settings

What do you see there? Have you selected the bridge?
Thanks for the prompt reply. That was a good suggestion.

I actually have a UI bug where I can't open the settings on the "Installed Applications" page. Clicking on any of the points listed in the |Settings| drop-down menu does nothing at all. I had to go to the "Available Applications" tab to open the Advanced Settings. The |Settings| drop-down menu is unusable in any other tab.

I set Node IP, Interface (br0) and Gateway and now the app Web-interfaces are reachable and they seem to deploy correctly.

Thank you very much!
 

Deeda

Explorer
Joined
Feb 16, 2021
Messages
65
I think this is what you guys are after and this is how I did mine...

Note:
1. Follow the sequence. Failing to do so you'll run into interfaces advising you that the IP is being used.
2. Do not test / apply changes till Step #3.

1. Remove IP Addresses > Aliases
View attachment 53588

View attachment 53589

2. Add BR01 interface (make sure DHCP is enabled), Add Bridge members (enp2s0f0)
View attachment 53590

3. Test changes
View attachment 53591

4. Attach NIC to BR01
View attachment 53592

5. Find IP of VM (through display and the usual IPCONFIG in the VM) then use RDP for better visuals. Ping BR01 (for my test it was 192.168.0.10)
View attachment 53593

6. Connect to SMB
View attachment 53594

7. Connection established
View attachment 53595

Just wanted to say thank you for these instructions, made it easy to fix this issue.

Also, this URL no longer works: https://www.truenas.com/docs/scale/virtualization/accessingnasfromvm/
 

Deeda

Explorer
Joined
Feb 16, 2021
Messages
65
Ok so one slight random thing. During this process I connected another network port on the system just in case it went wrong... it was set it DHCP and had a different address (192.168.0.111) compared to the static one I assigned to the bridge connection (192.168.0.6). Now when I disconnect that second network connection physically from the server, the TrueNAS Scale admin interface won't load, and the static IP I assigned to the bridge doesn't work?! Eg, can't ping 192.168.0.6
 
Last edited by a moderator:

georgios

Cadet
Joined
Dec 6, 2021
Messages
3
It works also for me, but is it normal that a PING from VM to host IP takes ~ 0.600 ms and can that be improved?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It works also for me, but is it normal that a PING from VM to host IP takes ~ 0.600 ms and can that be improved?

It can be normal. If you're expecting that this should take 0.000ms because it is all on the same host, that's unrealistic. You have to remember that this is a fake ethernet. There isn't an ethernet chipset involved, therefore no interrupts occur when running packets on this path, so when the ping happens in the VM, it queues up to be handed off to the bridge that connects to the host, is eventually processed at the next time the host's network processing works that queue, the host generates a response, runs that over the bridge, and now the packet has to wait for the next time the VM gets a timeslice to run, at which point it gets processed.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
A ping of one of my local interfaces on my Mac has got an RTT of roughly .130 ms. So that's just the latency of the local stack on a pretty fast machine. In case of a VM or a jail you are dealing with two separate stacks so you must at least double that in your expectations. Then add what @jgreco wrote and you end up with your .600 figures.

I consider anything lower than 1 ms "fast enough not to matter". I don't do high speed trading. :wink:
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
In case of a VM or a jail you are dealing with two separate stacks so you must at least double that in your expectations.

Well, it's really the time it takes for the scheduler to come around and allocate the VM a timeslot in which to run, that's what is probably the majority of the time. From the perspective of the host machine, a VM works similarly to a userland process. So if the VM is runnable but not actually running, you may end up having to wait just a bit for the guest to be able to run.
 

TinyWorkshop

Dabbler
Joined
Jul 14, 2022
Messages
40
For those who are struggeling with doing it with GUI. I find out that you need to STOP not only VM before changing anything in network but also Apps you have in TrueNAS Scale. I managed to change all in GUI without restart when I Stopped all Apps and VM.
Also after that you need to chceck your Apps configuiration if you set Host IP for an App and also change Interface to brX. Like for example Unifi below in my configuration:
View attachment 53059

I send request to add those information into Official Documentation of TrueNAS Scale :)
Sir, you saved my day

stopping all the VM an the apps worked immediately
 

Butcher9_9

Cadet
Joined
Sep 29, 2023
Messages
2
This worked for me but too just to make it more clear.
  1. Remove the IP from my primary NIC -> Apply
  2. Create a bridge
    1. Assign the primary NIC as only member to that bridge
    2. Assign the IP formerly attached to the NIC to the bridge
    3. Apply
  3. Test Network Changes
    1. I have 2 nic on 2 different networks so I didn't have to wait 40 seconds 88.0/24 internal uses 89.0/24 external use
  4. Click on Virtualization
    1. Select VM
      1. Device
      2. Nic
      3. Bind to Br#
Perfect , thanks Tried a few different fixes and this one worked first time
 

Scott207

Cadet
Joined
Oct 29, 2023
Messages
2
This worked for me but too just to make it more clear.
  1. Remove the IP from my primary NIC -> Apply
  2. Create a bridge
    1. Assign the primary NIC as only member to that bridge
    2. Assign the IP formerly attached to the NIC to the bridge
    3. Apply
  3. Test Network Changes
    1. I have 2 nic on 2 different networks so I didn't have to wait 40 seconds 88.0/24 internal uses 89.0/24 external use
  4. Click on Virtualization
    1. Select VM
      1. Device
      2. Nic
      3. Bind to Br#
u r the best!
 

infoman

Dabbler
Joined
Nov 13, 2023
Messages
11
For those who have lost wg-easy, you need to register a bridge in the settings line:

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o br0 -j MASQUERADE; iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT;

And rewrite the port forwarding line in the router (if you have one), and reboot the router (since sometimes the mac address hangs up with the old one, and your new bridge has a new mac address)
 
Last edited by a moderator:

LGSONE

Dabbler
Joined
Mar 8, 2014
Messages
19
This worked for me but too just to make it more clear.
  1. Remove the IP from my primary NIC -> Apply
  2. Create a bridge
    1. Assign the primary NIC as only member to that bridge
    2. Assign the IP formerly attached to the NIC to the bridge
    3. Apply
  3. Test Network Changes
    1. I have 2 nic on 2 different networks so I didn't have to wait 40 seconds 88.0/24 internal uses 89.0/24 external use
  4. Click on Virtualization
    1. Select VM
      1. Device
      2. Nic
      3. Bind to Br#
Following these instructions based on the success others have had. I have run into a problem trying to remove the IP address from line 1. All VM's are shut down, but I receive this message and I do not even have any apps installed. Fresh install of TrueNAS-SCALE-23.10.1.1 Everything is working perfectly except for this. Trying to install the TrueNas add-on in Home Assistant and i get errors for no communication and cannot ping the scale server from the VM.

Untitled.png


Apps screen shows nothing installed, but the TrueCharts repository. It seems the applications service is keeping this from allowing the deletion of the IP from the interface.

1706065081093.png



Any ideas on how to shut down this service or allow the unbinding of the ip address to the interface.
This worked for me but too just to make it more clear.
  1. Remove the IP from my primary NIC -> Apply
  2. Create a bridge
    1. Assign the primary NIC as only member to that bridge
    2. Assign the IP formerly attached to the NIC to the bridge
    3. Apply
  3. Test Network Changes
    1. I have 2 nic on 2 different networks so I didn't have to wait 40 seconds 88.0/24 internal uses 89.0/24 external use
  4. Click on Virtualization
    1. Select VM
      1. Device
      2. Nic
      3. Bind to Br#


Sorry for digging up an older post. It has the fix, or at least the closest I have found.

I'm a bit rusty on my subnet masking, and if it is an issue with the IP (172.20.2.0/24) I have on my interface, it may not even matter, but below are the application's advanced settings.

1706065857567.png


LGS
 
Last edited:

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Apps screen shows nothing installed, but the TrueCharts repository. It seems the applications service is keeping this from allowing the deletion of the IP from the interface.
Maybe you can try to un-set the app pool, which should stop the k3s service.
 

LGSONE

Dabbler
Joined
Mar 8, 2014
Messages
19
Maybe you can try to un-set the app pool, which should stop the k3s service.
Thanks, Tprelog, I unset the pool, the app service shutdown, made changes, tested, and reset apps pool and all is good. Thank you.

LGS
 
Top