Can not visit host ip address inside virtual machine

andrewc9

Cadet
Joined
Nov 8, 2021
Messages
7
my truenas host ip is 10.31.0.110. my wibdows 10 virtual machine's ip is 10.31.0.251. i could not visit truenas with ip in windows 10 virtual machine. how can i made this happen?
 

LarsR

Guru
Joined
Oct 23, 2020
Messages
719
you need to create a bridge. add your primary nic to that bridge and asign your vm to the bridge instead of the nic itself.
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
Like @LarsR mentioned you need a bridge.

To set up the bridge for your main interface correctly from the WebGUI you need to follow specific order of steps to not loose connectivity:
  1. Set up your main interface with static IP by disabling DHCP and adding IP alias (use the same IP you are connected to for easy results)
  2. Test Changes and then Save them (important)
  3. Edit your main interface, remove the alias IP
  4. Don't click Test Changes
  5. Add a bridge, name it something like br0, select your main interface as a member and add the IP alias that you had on main interface
  6. Click Apply and then Test Changes
  7. It will take longer to apply than just setting static IP, you can even get a screen telling you that your NAS in offline but just wait - worst case scenario TrueNas will revert to old network settings.
  8. After 30sec you should see an option to save changes.
  9. After you save them you should see both your main interface and new bridge active but bridge should have the IP
Now you just assign the bridge as an interface for your VM.
 

andrewc9

Cadet
Joined
Nov 8, 2021
Messages
7
Like @LarsR mentioned you need a bridge.

To set up the bridge for your main interface correctly from the WebGUI you need to follow specific order of steps to not loose connectivity:
  1. Set up your main interface with static IP by disabling DHCP and adding IP alias (use the same IP you are connected to for easy results)
  2. Test Changes and then Save them (important)
  3. Edit your main interface, remove the alias IP
  4. Don't click Test Changes
  5. Add a bridge, name it something like br0, select your main interface as a member and add the IP alias that you had on main interface
  6. Click Apply and then Test Changes
  7. It will take longer to apply than just setting static IP, you can even get a screen telling you that your NAS in offline but just wait - worst case scenario TrueNas will revert to old network settings.
  8. After 30sec you should see an option to save changes.
  9. After you save them you should see both your main interface and new bridge active but bridge should have the IP
Now you just assign the bridge as an interface for your VM.
My main interface is a Link Aggregation called bond0, I had set up a static IP bind at router. I had add a bridge called br0, select bond0 as member, add 10.31.0.0/24 as IP aliases.
Now I can choose br0 as nic in Virtual Machine devices page, but it still could not ping-through bond0's ip after virtual machine restarted.
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
10.31.0.0/24 is not a correct IP for a device. That is a network address. Try something different.
 

roysen

Dabbler
Joined
Dec 11, 2021
Messages
15
To set up the bridge for your main interface correctly from the WebGUI you need to follow specific order of steps to not loose connectivity:
  1. Set up your main interface with static IP by disabling DHCP and adding IP alias (use the same IP you are connected to for easy results)
  2. Test Changes and then Save them (important)
  3. Edit your main interface, remove the alias IP
  4. Don't click Test Changes
  5. Add a bridge, name it something like br0, select your main interface as a member and add the IP alias that you had on main interface
  6. Click Apply and then Test Changes
  7. It will take longer to apply than just setting static IP, you can even get a screen telling you that your NAS in offline but just wait - worst case scenario TrueNas will revert to old network settings.
  8. After 30sec you should see an option to save changes.
  9. After you save them you should see both your main interface and new bridge active but bridge should have the IP
Now you just assign the bridge as an interface for your VM.
I used this method and it worked for a while (a couple of hours). But after a time I can't reach my TrueNas anymore, seems like all inbound traffic is stopped. This has happened twice today. I can still reach LAN and WAN from my TrueNas but I'm not able to ping, ssh or reach the web GUI. My bridge br0 is connected to my 10 GB network adapter, but I have a built-in 1GB NIC that is connected but not in use, can I use that one in VM without bridging?
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
I used this method and it worked for a while (a couple of hours). But after a time I can't reach my TrueNas anymore, seems like all inbound traffic is stopped. This has happened twice today. I can still reach LAN and WAN from my TrueNas but I'm not able to ping, ssh or reach the web GUI. My bridge br0 is connected to my 10 GB network adapter, but I have a built-in 1GB NIC that is connected but not in use, can I use that one in VM without bridging?
Strange, my TrueNas is working with this bridge configuration for days now without issue.

When it comes to second interface - not sure, never tried it but should work in theory.
 

roysen

Dabbler
Joined
Dec 11, 2021
Messages
15
Strange, my TrueNas is working with this bridge configuration for days now without issue.

When it comes to second interface - not sure, never tried it but should work in theory.
I might have the same problem as in this post. I tried with my second NIC but it only made my Scale setup confused of which NIC to outbound traffic to. It started to use my 1GiB Nic instead of my 10GiB Nic.
 

andrewc9

Cadet
Joined
Nov 8, 2021
Messages
7
Strange, my TrueNas is working with this bridge configuration for days now without issue.

When it comes to second interface - not sure, never tried it but should work in theory.
I have the same problem as well. I am try to change my router's IP aliases, and change PC's gateway to bridge IP, and I can reach my truanas server again.
 

cengin

Cadet
Joined
Oct 2, 2022
Messages
1
Like @LarsR mentioned you need a bridge.

To set up the bridge for your main interface correctly from the WebGUI you need to follow specific order of steps to not loose connectivity:
  1. Set up your main interface with static IP by disabling DHCP and adding IP alias (use the same IP you are connected to for easy results)
  2. Test Changes and then Save them (important)
  3. Edit your main interface, remove the alias IP
  4. Don't click Test Changes
  5. Add a bridge, name it something like br0, select your main interface as a member and add the IP alias that you had on main interface
  6. Click Apply and then Test Changes
  7. It will take longer to apply than just setting static IP, you can even get a screen telling you that your NAS in offline but just wait - worst case scenario TrueNas will revert to old network settings.
  8. After 30sec you should see an option to save changes.
  9. After you save them you should see both your main interface and new bridge active but bridge should have the IP
Now you just assign the bridge as an interface for your VM.
It works, thank you
 

tsr966

Dabbler
Joined
Nov 12, 2019
Messages
16
Is this something they will fix in future updates?
 

gdarends

Explorer
Joined
Jan 20, 2015
Messages
72
It seems to be documented here....
 

ro55_mo

Dabbler
Joined
Feb 3, 2018
Messages
16
Is this something they will fix in future updates?
I am guessing not as it is the designed behavior of the Linux QEMU-KVM hypervisor which SCALE uses. This is exactly the issue I had to overcome when I wanted a VM on a Raspberry Pi running via QEMU-KVM to communicate with the Pi itself.
 
Top