0

I've had a tough time trying to find a solution that specifically deals with accessing a virtualbox Ubuntu server from windows.

The objective is to have two adapters set. Adapter 1 is NAT and would be used to provide internet access for the guest machine (the linux server) so that there apt-get is possible. I do not want the virtual machine to be accessible from the external web so I am not wanting a bridged adapter in this instance.

Adapter 2 is a host-only network adapter that is not using DHCP since it going to have a static IP address with the intention of being the IP address the host machine uses for accessing the VM with Putty.

I have set up and configured a host-only adapter via VirtualBox general settings and it has the IPv4 address/Mask of 192.168.194.3/24. I have configured this to be set up manually and gave it the IP address of 192.168.194.3 and the network mask: 255.255.255.0.

the /etc/network/interfaces file has been modified to reflect a static ip address at network adapter enp0s8 (the host-only adapter #2)

auto enp0s8
iface enp0s8 inet static
address 192.168.194.3
netmask 255.255.255.0

From my windows host computer, I can ping 192.168.194.3 and get a response.

I have installed openssh-server on the linux guest and it is running. It claims to be running and listening on 0.0.0.0 port 22.

What is the appropriate way for me to set up and configure things so that I am not using a bridged network adapter and am still able to use NAT but I connect to the VM through a static IP assigned to the 2nd adapter which is a host-only adapter? I believe this is possible, but I could use some assistance.

Thanks in advance

  • It is not clear why you want to have two virtual network adapters in the VM -- what's wrong with accessing the VM through the first virtual network adapter? It is not clear what version of Ubuntu you are using -- something old, given that you are using interfaces. It is not clear what addresses do the virtual network adapters on the host have. – AlexP Jul 2 '18 at 4:52
  • Host-only adapter is pretty much the right way to access your guest, I'd suggest you to check guest ssh server from inside first, after entering to VM console. If it really up, it can be restricted by guest firewall. – Tagwint Jul 2 '18 at 9:12
  • Have you setup the host-side virtual interface with the same network? – Rui F Ribeiro Jul 2 '18 at 12:07
  • @alexp - it's not clear to me either. I did manage to drop the 2nd adapter and just port forward through the NAT adapter which worked, but for some reason I believed having a static IP address assigned by a host only adapter (2nd adapter) would enable me to SSH at that address and avoid port forwarding which may be totally incorrect. – Brandon J Jul 3 '18 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.