I hope you're doing great wherever you are.
I been struggling with the following issue for the whole day and I'm starting to bang my head again the wall.
Here is my setup :
[*]Host : Windows 10 + VirtualBox 6.
- -> VirtualBox Host network manager : 192.168.88.1 / 255.255.255.0 no DHCP
- -> Network adapter 1 (internet) : Automatic
- -> -> Network adapter 2 (for Jetson network) : 192.168.88.13 / 255.255.255.0
[*]VM : Ubuntu 18.04 LTS[/list]
- - > Adapter 1 NAT => (enp0s3) set to static IP ( cf. yaml file) -> 192.168.88.40/24
- -> Adapter 2 Bridged (for internet connectivity) => (enp0s8) default settings
- -> VirtualBox Host network manager : 192.168.88.1 / 255.255.255.0 no DHCP
- -> Network adapter 1 (internet) : Automatic
- -> -> Network adapter 2 (for Jetson network) : 192.168.88.13 / 255.255.255.0
- -> IP (Static) : 192.168.88.1 / 255.255.255.0
In principle the VM is supposed to run the same code as the physical hardware (I’m not trying to emulate the arm64 Jetson architecture for now, just the OS is the same).
Thus their IPs are the same and set to static.
As I cannot expose the VM static with a Bridge or Host-Only adapter, as the IP will be conflicting (192.168.88.40).
I went for a NAT adapter on the VM with a port forwarding policy to hide the VM static IP (cf rule above) for the VM host.
Code: Select all
Port Forwarding rule :
| _Name_ | _Protocol_ | _Host IP_ | _Host Port_ | _Guest IP_ | _Guest Port_ |
|--------|------------|---------------|-------------|---------------|--------------|
| SSH | TCP | 192.168.88.1 | 9099 | | 22 |
Code: Select all
ssh -l vbuntu 192.168.88.1 -p 9099
And as expected, the associated ip is not visible from the outside (ex: via ping), which is great news for my usecase.
But if enp0s3 is set to a static IP, I cannot log-in anymore with the exact same forwarding rule.
I’ve tried with various *Host IP* (void, 127.0.0.1,192.168.88.1) and various Guest IP (void, 192.168.88.40, 127.0.0.1 ) nothing worked and this drive me crazy.
I’m kinda newby regarding virtualisation and some help would be greatly appreciated here.
Do you know a way to solve this issue?
All the best
JDupont
Code: Select all
——— Yaml Configuration : /etc/netplan/01-netcfg.yaml (some indentations might have been lost)———
# Yaml netplan config files
network:
version: 2
ethernets:
enp0s3:
dhcp4: no
addresses: [192.168.88.40/24]
gateway4: 192.168.88.1
Code: Select all
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.88.40 netmask 255.255.255.0 broadcast 192.168.88.255
inet6 fe80::a00:27ff:feb0:20fb prefixlen 64 scopeid 0x20<link>
ether 08:00:27:b0:20:fb txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 130 bytes 11085 (11.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.255.43.65 netmask 255.255.255.0 broadcast 10.255.43.255
inet6 fe80::7112:afa8:f57f:3ef prefixlen 64 scopeid 0x20<link>
ether 08:00:27:41:d8:3e txqueuelen 1000 (Ethernet)
RX packets 105 bytes 12741 (12.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 6295 (6.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 262 bytes 22620 (22.6 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 262 bytes 22620 (22.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0