[OpenIndiana-discuss] Vbox and nwam -no vboxnet0 ?
Tony Brian Albers
tba at kb.dk
Fri Feb 5 15:12:41 UTC 2021
On 02/05/21 03:36 PM, Stephan Althaus wrote:
> On 02/05/21 14:09, Tony Brian Albers wrote:
>> Hi guys,
>>
>> I'm trying to get VirtualBox to work properly.
>>
>> In the main window, when I select Tools -> Network, I can see a network
>> called vboxnet0
>> The configuration says:
>> Adapter:
>> IPv4 Address: 192.168.56.1
>> IPv4 Network Mask: 255.255.255.0
>>
>> DHCP Server:
>> Server Address: 192.168.56.100
>> Server Mask: 255.255.255.0
>> Lower Address Bound: 192.168.56.101
>> Upper Address Bound: 192.168.56.254
>>
>> It seems to be working, I can use it in a VM, it's connected to Adapter
>> 2 and I can get a DHCP address and ping the DHCP server 192.168.56.100.
>>
>> But I can't connect to the host on 192.168.56.1, and on the host I
>> haven't got an interface that matches that network:
>>
>> root at emu:~# ipadm show-if
>> IFNAME STATE CURRENT PERSISTENT
>> lo0 ok -m-v------46 ---
>> rge0 ok bm--------4- ---
>> tun0 ok -mp-------4- ---
>> root at emu:~#
>>
>> root at emu:~# nwamadm list -x
>> TYPE PROFILE STATE AUXILIARY STATE
>> ncp Automatic disabled disabled by administrator
>> ncp Home online active
>> ncu:phys rge0 online interface/link is up
>> ncu:ip rge0 online interface/link is up
>> loc Automatic offline conditions for activation are
>> unmet
>> loc Home online active
>> loc NoNet offline conditions for activation are
>> unmet
>> loc User disabled disabled by administrator
>> root at emu:~#
>>
>> According to the documentation, it should be possible to connect from
>> the host to the VM on it's Host-only network address. But vboxnet0
>> doesn't seem to exist on the host.
>>
>> Any ideas?
>>
>> Thanks,
>>
>> /tony
>>
>>
>>
> Hi Tony!
>
> I currently have a running vbox vm with bridged adapter,
> i have no special host-only things either.
>
> My vm can reach each used ip on the local net.
> Maybe you hav to look elsewhere, ping, traceroute, route, ipfilter,.
>
> ipadm show-if
> IFNAME STATE CURRENT PERSISTENT
> lo0 ok -m-v------46 ---
> e1000g4 ok bm--------46 ---
>
> $ ipadm show-addr
> ADDROBJ TYPE STATE ADDR
> lo0/v4 static ok 127.0.0.1/8
> e1000g4/_b dhcp ok 192.168.2.63/24
> lo0/v6 static ok ::1/128
> e1000g4/_a addrconf ok fe80::a64c:c8ff:fe79:c2f2/10
>
Hi Stephan,
Yes, I'm able to do that too. But my issue is that I need the VM to use
a NAT network, and that makes it impossible to get to it from the host.
However, I have made a workaround:
1. Create a extra IP-address on the hosts interface, something like:
nwamcfg:ncp:Home> list ncu ip rge0
ncu:rge0
type interface
class ip
parent "Home"
enabled true
ip-version ipv4
ipv4-addrsrc static
ipv4-addr "172.16.1.9/24","172.16.3.9/24"
^^^^^^^^^^^^^^^
ipv4-default-route "172.16.1.1"
nwamcfg:ncp:Home>
2. Attach adapter2(adapter1 is connected to 'NAT') in vbox vm to
"bridged interface" -> the hosts interface rge0
3. Set a static IP on the new interface on the vm, don't specify a gateway:
enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
UP group default qlen 1000
link/ether 08:00:27:de:11:d5 brd ff:ff:ff:ff:ff:ff
inet 172.16.3.15/24 brd 172.16.3.255 scope global noprefixroute enp0s8
4. ssh from the host to 172.16.3.15 :)
/tony
P.S. The Host-only network _should_ be plumbed and configured on the
host according to VirtualBox's docs:
https://www.virtualbox.org/manual/ch06.html#network_hostonly
I suppose this might be a bug.
--
Tony Albers - Systems Architect - IT Development Royal Danish Library,
Victor Albecks Vej 1, 8000 Aarhus C, Denmark
Tel: +45 2566 2383 - CVR/SE: 2898 8842 - EAN: 5798000792142
More information about the openindiana-discuss
mailing list