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

otpi

Contributor
Joined
Feb 23, 2017
Messages
117
I had a timeout problem when I tried to create a bridge from GUI, everything I did failed. However; I was missing a crucial piece:
From the Truenas Scale 'network' GUI find the NIC used to access the GUI. Edit and deselect DHCP and 'add' static IP. Test and commit. That fixed it for me. Now the GUI should not get lost when you test changes.

I had reserved the GUI IP in pfSense, thinking it was sufficient, and that caused my problems.
 

engineerdj

Dabbler
Joined
Jan 17, 2022
Messages
21
The procedure you've described, worked for me. After pressing "Test Changes" do you reload the browser-tab?

When I do that the page will load for maybe 40 sec. or so but at some point the UI will load and at that point I can save the changes.

If you just stay on the tab, it will just revert back after the 60 sec.

This is the exact solution that solved my problem. All within the UI/browser. No reboot or command line needed.

During Test Changes, reload the UI in another tab using the same IP, to Save Config before Revert.

After clicking Test Changes, the UI will have the modal appear that it's testing the changes with the spinner and the other text box that appears (Connecting to TrueNAS?). During that time, I opened another tab to access the UI and it brought me right back into the config with the Save Configuration option present.

Remove the IP from my primary NIC -> Apply
Create a bridge
Assign the primary NIC as only member to that bridge
Assign the IP formerly attached to the NIC to the bridge
Apply
Test Network Changes
Reload TrueNAS UI using the same IP address in another tab
Save Config

Once saved, you'll see br0 with the correct IP attached. I then bound the bridge to the VM, started it, and can now access the NAS network shares from within the VM.

The docs (https://www.truenas.com/docs/scale/virtualization/accessingnasfromvm/) aren't wrong, and it may not be a bug, but it should have a note that you may have to reload the UI in another tab to save config, else the 60 seconds will elapse without saving and the changes revert.

I've seen many with the same issue thinking it's a bug. Knowing the above would save a lot of time and troubleshooting. Been working on this one one and off for about a week, and this fixed it in 40 seconds.
 

colemar

Dabbler
Joined
Feb 12, 2022
Messages
13
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:
1644658029518.png


I send request to add those information into Official Documentation of TrueNAS Scale :)
 

twk95

Dabbler
Joined
Oct 27, 2015
Messages
15
I continued to have issues on my VM even after correcting the bridge settings. If you're using the same VM from CORE then check your /etc/netplan/* config from inside the VM. In my case I needed to update sudo nano /etc/netplan/00-installer-config.yaml that was created on CORE. It was originally set to enp0s4 but changed it to ens3 which I found doing "ps a" from the VM shell. Hope this helps someone, spent ages trying to get VM connectivity haha
 

2020HST

Cadet
Joined
Feb 26, 2022
Messages
1
This is the exact solution that solved my problem. All within the UI/browser. No reboot or command line needed.

During Test Changes, reload the UI in another tab using the same IP, to Save Config before Revert.

After clicking Test Changes, the UI will have the modal appear that it's testing the changes with the spinner and the other text box that appears (Connecting to TrueNAS?). During that time, I opened another tab to access the UI and it brought me right back into the config with the Save Configuration option present.

Remove the IP from my primary NIC -> Apply
Create a bridge
Assign the primary NIC as only member to that bridge
Assign the IP formerly attached to the NIC to the bridge
Apply
Test Network Changes
Reload TrueNAS UI using the same IP address in another tab
Save Config

Once saved, you'll see br0 with the correct IP attached. I then bound the bridge to the VM, started it, and can now access the NAS network shares from within the VM.

The docs (https://www.truenas.com/docs/scale/virtualization/accessingnasfromvm/) aren't wrong, and it may not be a bug, but it should have a note that you may have to reload the UI in another tab to save config, else the 60 seconds will elapse without saving and the changes revert.

I've seen many with the same issue thinking it's a bug. Knowing the above would save a lot of time and troubleshooting. Been working on this one one and off for about a week, and this fixed it in 40 seconds.
After following the instructions in the article https://www.truenas.com/docs/scale/virtualization/accessingnasfromvm/ I noticed one step missing in your steps: You didn't check the DCHP box for the bridge connection. When I tried it without setting the DCHP in the bridge, it worked! Now to see if I can access my NAS from WIN 10 in a VM...
 

kketchev

Cadet
Joined
Apr 12, 2021
Messages
4
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#
I am updated to the latest Scale "Release" that just came out on 2/22/22. This does not work. It takes longer then 60 seconds and reverts back to original network settings. Hope this gets fixed in the later releases.
 
Joined
Feb 28, 2022
Messages
1
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
1646045489362.png


1646045500706.png


2. Add BR01 interface (make sure DHCP is enabled), Add Bridge members (enp2s0f0)
1646045560145.png


3. Test changes
1646045579863.png


4. Attach NIC to BR01
1646045596808.png


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)
1646045686996.png


6. Connect to SMB
1646045750130.png


7. Connection established
1646045771532.png
 

ForceX

Cadet
Joined
Mar 12, 2022
Messages
8
I spent a few hours following the steps trying to get this to work. Every time I would test the settings I would loose connection and the settings would timeout and revert back. Then I noticed something. My router was handing a different IP to the bridge than I had specified in the gui. I had to capture that IP and log back into TrueNas before time expired and save the settings.

Here is what I recommend trying if you are unable to get everything listed to work up to this point.

  1. Disable DHCP / Clear current IP from the primary NIC -> Apply
  2. Create a bridge
    1. Assign the primary NIC as only member to that bridge
    2. Enable DHCP to the bridge. Do not assign an IP manually
    3. Apply
  3. Test Network Changes
  4. Check your router for the new IP to your bridge
  5. Quickly log into TrueNas using the new IP given to the bridge (depending on how often your router updates it's IP pool to display on its gui you may have to try a few times to get lucky to see it appear)
  6. Save network settings
  7. Click on Virtualization
    1. Select VM
      1. Device
      2. Nic
      3. Bind to Br#
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Using DHCP for server role machines is not a good idea in general. Second, you can increase the timeout by entering e.g. 180 (seconds) before clicking "Test".

Kind regards,
Patrick
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
How i can release IP from my router (DHCP server) for Bridge?
Use the UI or command line of your router. Consult the documentation on how to do that. Sorry, without knowing the vendor and precise model, how should anyone be able to tell?
 

luddite

Cadet
Joined
Apr 12, 2022
Messages
1
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#
I am having the exact issue however the test step 3 fails. Would I be better off doing this from the console?
 

Xenouniv3rse

Dabbler
Joined
Feb 14, 2022
Messages
23
Okay, you really made my day! It actually did work without any issues, using only the GUI and without reboot!

Here is what I did:
  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
It took quite a while like 40 seconds before the GUI was able to reconnect, so I had only a few seconds to click the button to make changes permanent.

After that I assigned the NIC of my VM to the bridge and started it. Now it connects to the host without issue. Thanks again! Hope this helps others here searching to the same thing.
I tried this, but then I cant access the UI from outside the network. Is there a different way to do it to still keep the Host on the actual network adapter instead of the bridged adapter?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
but then I cant access the UI from outside the network
Can you describe that a little more clearly?

What UI?

Is there a different way to do it to still keep the Host on the actual network adapter instead of the bridged adapter?
That's not a thing to want as it's an incorrect network setup for Linux. I suspect there's something else not right that you need to fix so you can do the bridge properly and it will be fine.
Make sure you're also defining the default route and nameserver(s) in the Network Global Configuration
 

fetchi

Cadet
Joined
Feb 26, 2021
Messages
2
I tried to follow the guide that was linked to in this thread. However I was running into an issue. On the create bridge screen the settings would not take no matter what if I selected the DHCP checkbox.

If I did it ignore the static IP I set in the add IP alias box. It would allow me to add the settings below.
bridge.png


However after I saved and attempted to test the settings it would choose some random IP on the subnet.
randomIP.png


When I went back in the "DHCP" box would still be checked but the IP I had added in the bottom section was now missing. It was like I never added an IP.

Now I figured maybe it was an issue and I would just go back in and add the IP settings after all the changes had been saved. HOWEVER the bridge would just not accept that no matter what. Whenever I tried adding the correct IP and hit save the settings would never validate.

The only way I could get it to show the correct IP was if I left DHCP box unchecked.

The good news is everything works without the DHCP box checked but I am sure that will cause unrelated issues down the road.
 

nullnix

Cadet
Joined
Oct 7, 2014
Messages
4
I too tried to follow the above steps of removing the IP from the NIC and assigning it to a bridge with the NIC as a member.

I was unsuccessful.
The NAS becomes unreachable until the test timer expires, even if I set it to 240 seconds.

I can create a bridge with a different subnet and attach that to the VM, so it can access the host via that subnet, but connecting the bridge to the NIC does not appear to work. So there is no way to access the host via the standard LAN address, which is kind of annoying.
 

fetchi

Cadet
Joined
Feb 26, 2021
Messages
2
I too tried to follow the above steps of removing the IP from the NIC and assigning it to a bridge with the NIC as a member.

I was unsuccessful.
The NAS becomes unreachable until the test timer expires, even if I set it to 240 seconds.

I can create a bridge with a different subnet and attach that to the VM, so it can access the host via that subnet, but connecting the bridge to the NIC does not appear to work. So there is no way to access the host via the standard LAN address, which is kind of annoying.

This is because for whatever reason your NIC/Bridge was assigned a new IP when you tried to apply the settings. The Alias "static" IP you added was ignored and your router assigned the machine a new IP.

Follow the steps like you did but check the truenas console(yes you need to hookup a monitor) for the new IP. Login to truenas again with that IP and save the configuration. You should now be able to use your truenas server and bridge on the new assigned IP.

Why this is happening I have no idea. For whatever reason truenas will just NOT use the IP you added as an alias when you apply changes. I am going to make a video this weekend to document. Maybe we are doing something wrong I have no idea.
 

Andreuha

Cadet
Joined
Oct 31, 2021
Messages
3
I too tried to follow the above steps of removing the IP from the NIC and assigning it to a bridge with the NIC as a member.

I was unsuccessful.
The NAS becomes unreachable until the test timer expires, even if I set it to 240 seconds.

I can create a bridge with a different subnet and attach that to the VM, so it can access the host via that subnet, but connecting the bridge to the NIC does not appear to work. So there is no way to access the host via the standard LAN address, which is kind of annoying.
This is exactly how I had it working just fine in 22.02.01.
Today I updated from 22.02.01 to 22.02.1 and that no longer works.

I removed the NIC and bridge on my VM and went through these steps again...
I've tried a pile of variations of IP and subnet, NIC type, address ranges, different things on the client VM -- unable to access any IP tied to the NAS.

Kind of at a loss for what else to try at this point.
 
Last edited:

nullnix

Cadet
Joined
Oct 7, 2014
Messages
4
Alright I've made some progress after updating to 22.02.2.

When I followed the same steps ForceX has mentioned above, it seems like the bridge finally accepted the IP address and was pingable but for some reason neither port 22 or 443 were open, so the web interface was unreachable.

I managed to finally get it to work by assigning a different IP to the new bridge than the one that was originally assigned to the NIC.

I have no idea if 22.02.2 had anything to do with it, but I'm glad it works now. I just hope another update won't break it again.
 

nullnix

Cadet
Joined
Oct 7, 2014
Messages
4
I think I now have a different problem.

VMs can now access the host without a problem but apps are causing issues. None of the web portals of my apps are reachable, I think the kubenetes port forwarding is messed up due to the bridge interface?

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.
 
Top