I built a Linux guest VM with IP address 192.168.1.91. This VM is functioning as server, providing services on the network (e.g. yum, http). The guest has only one adapter, a bridged adapter. My configuration worked great while I was on my home network where my host (i.e. my laptop) was also on the 192.168.1.0/24 network.
Now I'm at a hotel. The hotel wifi assigned me an IP address in a different subnet (172.20.0.0/20) so I can no longer ssh from my host to my Linux VM, or access the resources that my Linux VM is serving up.
How you recommend I fix this so that the services my VM is offering up on the 192.168.0.1/24 network are accessible to me while my laptop is on a different subnet? For example, would adding a route at the guest or host level resolve my issue?
Thank you!
Networking Conundrum
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Networking Conundrum
You could set the VM's network to Host-Only, with the IP range set to 192.168.1.#/24, and the host only adapter at 192.168.1.1. Note the need to make or modify the /etc/vbox/networks.conf file to allow 192.168.1.# range, see https://www.virtualbox.org/manual/ch06. ... k_hostonly
You'll probably have to delete this network when you get back home so it won't interfere with your home network.
You'll probably have to delete this network when you get back home so it won't interfere with your home network.
Re: Networking Conundrum
Ohhh, that worked Thank you scottgus1!
As you said, I will need to remember to change the IP for the "VirtualBox Host-Only Ethernet Adapter" from 192.168.1.1 back to 192.168.56.1 (the default) when I get home.
The /etc/vbox/networks.conf file didn't exist yet on my guest, so I created it. It has one line:
* 192.168.1.0/24
Thanks again!
As you said, I will need to remember to change the IP for the "VirtualBox Host-Only Ethernet Adapter" from 192.168.1.1 back to 192.168.56.1 (the default) when I get home.
The /etc/vbox/networks.conf file didn't exist yet on my guest, so I created it. It has one line:
* 192.168.1.0/24
Thanks again!
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Networking Conundrum
Great! Glad you're up and running.