NFS access within the VM

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
HI,

I searched in the forum but didn't find anything related to this issue.
my linux vm can access anything on my network expect resources on the FreeNAS server 11.3-U4 (All under the same subnet).
No NFS no ICMP to the FreeNAS host from this VM.
seem to my like a known issue since I didn't do anything special on this Linux VM.
its Arch Linux and when showmount -e nfs_server it hangs and times out same goes for other services from this Linux VM to the FreeNAS host
what am I missing (ip forwording) ?

Thanks
 
Last edited:

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
HI,

I searched in the forum but didn't find anything related to this issue.
my linux vm can access anything on my network expect resources on the FreeNAS server 11.3-U4 (All under the same subnet).
No NFS no ICMP to the FreeNAS host from this VM.
seem to my like a known issue since I didn't do anything special on this Linux VM.
its Arch Linux and when showmount -e nfs_server it hangs and times out same goes for other services from this Linux VM to the FreeNAS host
what am I missing (ip forwording) ?

Thanks
I just used a dedicated NIC for the virtual machines and it works fine , is that the only way to go?
 
Joined
Jul 2, 2019
Messages
648
How about using VLANs?
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
How about using VLANs?

Thats a good solution but consider that its only my home :) I don't want to complicate things.
I set one NIC for VM's for now and its fine and better I think , just wanted to know if it should work when using the shared NIC
Thanks
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
The VM is supposed to attach to a tap interface, which joins bridge0. The bridge0 interface is auto-created on the 1st physical interface; if you're using another interface, you'd need to manually attach bridge0 to the other interface on boot.
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
The VM is supposed to attach to a tap interface, which joins bridge0. The bridge0 interface is auto-created on the 1st physical
when selecting in the VM to which Nic to use there is no Bridge0 only em interfaces

Thanks
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Please output ifconfig -a.
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
Please output ifconfig -a.
em0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:1e:67:83:d5:40
hwaddr 00:1e:67:83:d5:40
inet 192.168.252.253 netmask 0xffffff00 broadcast 192.168.252.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
em1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:1e:67:83:d5:41
hwaddr 00:1e:67:83:d5:41
nd6 options=1<PERFORMNUD>
media: Ethernet autoselect
status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:b4:a0:66:37:00
nd6 options=1<PERFORMNUD>
groups: bridge
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: vnet0.2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 7 priority 128 path cost 2000
member: vnet0.1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 6 priority 128 path cost 2000
member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 1 priority 128 path cost 20000
member: em1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 2000000
vnet0.1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: ns1 as nic: epair0b
options=8<VLAN_MTU>
ether 02:1e:67:68:57:46
hwaddr 02:d5:d0:00:06:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
vnet0.2: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: transmission as nic: epair0b
options=8<VLAN_MTU>
ether 02:1e:67:03:aa:46
hwaddr 02:d5:d0:00:07:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Yes, selecting em0 as the NIC to attach associates a tap interface with the bridge interface hosting em0. For example, on my system, this is how things are set up:

Code:
igb0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: igb0
        options=2400b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6>
        ether d0:50:99:01:33:9e
        hwaddr d0:50:99:01:33:9e
        inet6 fe80::d250:99ff:fe01:339e%igb0 prefixlen 64 scopeid 0x1
        inet6 2601:5c9:4200:4169:d250:99ff:fe01:339e prefixlen 64 autoconf
        inet6 fdce:7100:606a:0:d250:99ff:fe01:339e prefixlen 64 autoconf
        inet 192.168.0.30 netmask 0xffffff00 broadcast 192.168.0.255
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active

bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 02:6d:5e:0d:0e:00
        nd6 options=1<PERFORMNUD>
        groups: bridge
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 4 priority 128 path cost 2000000
        member: igb0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 20000

tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: Attached to rancher
        options=80000<LINKSTATE>
        ether 00:bd:87:55:42:00
        hwaddr 00:bd:87:55:42:00
        nd6 options=1<PERFORMNUD>
        media: Ethernet autoselect
        status: active
        groups: tap
        Opened by PID 46955


In your case, there doesn't seem to be a tap interface created. Can you output midclt call vm.query?
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
[{"id": 3, "name": "lampd", "description": "MPD Server", "vcpus": 4, "memory": 8192, "bootloader": "UEFI", "grubconfig": "", "autostart": false, "time": "LOCAL", "devices": [{"id": 11, "vm": 3, "dtype": "NIC", "attributes": {"type": "E1000", "mac": "00:a0:98:5f:93:82", "nic_attach": "em1"}, "order": 1003}, {"id": 12, "vm": 3, "dtype": "DISK", "attributes": {"path": "/dev/zvol/vol0/lampd-wrp0qc", "type": "AHCI", "sectorsize": 0}, "order": 1000}, {"id": 14, "vm": 3, "dtype": "VNC", "attributes": {"vnc_port": 5586, "wait": false, "vnc_resolution": "1024x768", "vnc_bind": "0.0.0.0", "vnc_password": "", "vnc_web": true}, "order": 1002}], "status": {"state": "STOPPED", "pid": null}}]
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
Yes, selecting em0 as the NIC to attach associates a tap interface with the bridge interface hosting em0. For example, on my system, this is how things are set up:

Code:
igb0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: igb0
        options=2400b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6>
        ether d0:50:99:01:33:9e
        hwaddr d0:50:99:01:33:9e
        inet6 fe80::d250:99ff:fe01:339e%igb0 prefixlen 64 scopeid 0x1
        inet6 2601:5c9:4200:4169:d250:99ff:fe01:339e prefixlen 64 autoconf
        inet6 fdce:7100:606a:0:d250:99ff:fe01:339e prefixlen 64 autoconf
        inet 192.168.0.30 netmask 0xffffff00 broadcast 192.168.0.255
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active

bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 02:6d:5e:0d:0e:00
        nd6 options=1<PERFORMNUD>
        groups: bridge
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 4 priority 128 path cost 2000000
        member: igb0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 20000

tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: Attached to rancher
        options=80000<LINKSTATE>
        ether 00:bd:87:55:42:00
        hwaddr 00:bd:87:55:42:00
        nd6 options=1<PERFORMNUD>
        media: Ethernet autoselect
        status: active
        groups: tap
        Opened by PID 46955


In your case, there doesn't seem to be a tap interface created. Can you output midclt call vm.query?
Thanks , but why bridge0 includes both interfaces em0,em1? , I didn't set that and I dont see the bridge0 in the web UI
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
OK, part of the problem is your VM devices aren't using contiguous orders. Your disk is order 1000, then it jumps to the NIC at order 1003, and finally the VNC device at order 1002.

If you change the NIC to order 1001, then there will be a contiguous range, and bhyve can then find the NIC and associate a tap interface. You can also change the NIC to use em0 instead of em1, which will remove em1 from bridge0.

I also recommend you change both your disk and NIC devices to use VirtIO, which has higher performance than the emulated AHCI and E1000.
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
Thanks , that didn't change the unable to access the FreeNAS nfs server
Screenshot 2020-07-26 at 20.32.52.png
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
When the VM is running, please output ifconfig -a, and enclose the output between [ CODE ][ /CODE ] blocks. (Remove spaces between the brackets and the BB code.)
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
Sorry , didn't understand [ CODE ][ /CODE ]

em0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:1e:67:83:d5:40
hwaddr 00:1e:67:83:d5:40
inet 192.168.252.253 netmask 0xffffff00 broadcast 192.168.252.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
em1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:1e:67:83:d5:41
hwaddr 00:1e:67:83:d5:41
nd6 options=1<PERFORMNUD>
media: Ethernet autoselect
status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:b4:a0:66:37:00
nd6 options=1<PERFORMNUD>
groups: bridge
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 4 priority 128 path cost 2000000
member: vnet0.2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 7 priority 128 path cost 2000
member: vnet0.1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 6 priority 128 path cost 2000
member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 1 priority 128 path cost 20000
member: em1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 2000000
vnet0.1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: ns1 as nic: epair0b
options=8<VLAN_MTU>
ether 02:1e:67:68:57:46
hwaddr 02:d5:d0:00:06:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
vnet0.2: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: transmission as nic: epair0b
options=8<VLAN_MTU>
ether 02:1e:67:03:aa:46
hwaddr 02:d5:d0:00:07:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: Attached to lampd
options=80000<LINKSTATE>
ether 00:bd:01:eb:35:00
hwaddr 00:bd:01:eb:35:00
nd6 options=1<PERFORMNUD>
media: Ethernet autoselect
status: active
groups: tap
Opened by PID 74238
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
OK, so your tap0 interface is being created correctly, and being bound to bridge0 correctly. Have you tried shutting down em1? Having both em0 and em1 connected to the same LAN isn't a supported configuration, even if em1 has no IP address. Then you can configure your VM NIC to bind to em0.
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
OK, so your tap0 interface is being created correctly, and being bound to bridge0 correctly. Have you tried shutting down em1? Having both em0 and em1 connected to the same LAN isn't a supported configuration, even if em1 has no IP address. Then you can configure your VM NIC to bind to em0.
found the problem , when I installed FreeNAS I kept all my sysctl options from my previous FreeBSD server and this was the issue

net.inet.ip.check_interface=0 (was 1)
 

ramib

Dabbler
Joined
Dec 31, 2019
Messages
41
OK, so your tap0 interface is being created correctly, and being bound to bridge0 correctly. Have you tried shutting down em1? Having both em0 and em1 connected to the same LAN isn't a supported configuration, even if em1 has no IP address. Then you can configure your VM NIC to bind to em0.
Thanks for your help , all this because of me :(
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You're welcome.
 
Top