![]() ![]() Remember, the enp0s3 is the adapter that can connect your Guest VM to the internet (For more info on how NAT works ) My enp0s8 is my Adapter #2 that I configured to be Host-Only My enp0s3 is my Adapter #1 that I configured to be NAT Inside the YAML file I wrote the following: network: ethernets: enp0s3: dhcp4: true enp0s8: addresses: - 192.168.211.3/24 version: 2 ![]() I found that I can still have my VirtualBox access the internet by allowing my Adapter 1 in (usually enp0s3 in Ubuntu Server) Virtualbox UI →Your VM→ Settings → Network set to Attached to: NATĪfter configuring all of the adapters, it’s now time to set our static IP inside our Ubuntu VM inside Virtual Box.įirst, I logged into the actual VM, not SSH’ed.Īfter I logged in, I went to my netplan YAML file (your default YAML might be named different.) sudo vim /etc/netplan/00-installer-config.yaml I reset /applied the netplan: sudo netplan apply Long Version: Adapter #1 ![]() ![]() Then, I changed my Adapter 1 (in this case, enp0s3, for Ubuntu)in my Netplan to dhcp4: true and added a static IP for my Adapter 2 ( for me it was enp0s8, it could vary for you.) to a static IP given by the DHCP server running from my Adapter 2 settings in Virtual Box. I was able to fix this by changing my Adapter 1 for my network to NAT, and then adding a Host-Only adapter to my Adapter 2 tab in VirtualBox ( Virtualbox UI →Your VM→ Settings → Network). I need a way to have to auto configure itself. When I changed networks when I traveled, I was unable to have my VM access the internet and I was unable to SSH into my VM while it was running with a static IP. In the content below, I will be doing my examples on an Ubuntu 20 running on Virtual Box 6.1 THE PROBLEM However, after doing some research, I was able to configure my VM so it can now always get to the internet on any network, but I am able to SSH from my host (local computer) to my VM (guest computer). However, the way I had my VM configured on my Virtual Box left me in a bit of a pickle because of the way I was using my static IPs as well as the Bridged Adapter of VirtualBox.Įverytime I would try to go into my office at Dree, I wouldn’t be able to get my VM to see the internet, which I thought was a bit strange since it worked in other networks. Throughout the week, I work from multiple locations around the Salt Lake City area and my laptop (Windows 10) connections to a variety of networks to perform my work. ![]()
0 Comments
Leave a Reply. |