Network access to VirtualBox VM from network PC


Tharik Kanaka

Well, I've setup a VM (labeled PC2) in the PC's Virtual Box, and I'm hosting a web service in the VM (IIS).

PC2-Windows Server 2003 VM-Windows 7 x86

Now I want to access the web service from another PC (labeled PC1) in the network that PC1 has connected to. The image below will help you clarify your thinking.

enter image description here

So the LAN is 192.168.5.0. But by default, the virtual network port IP is 192.168.56.1. In a VM its IP comes from DHCP by default. (ipconfig gives you an IP address like 10.0.0.2.15, subnet mask 255.255.255.0, gateway 10.0.2.2).

At this point, I can ping PC1 (192.168.5.31) from the VM (10.0.2.15), but not 10.0.2.15 from PC 1, even though I set the VM and PC2 virtual port IPs from the VM to some static range, I can't ping any IP.

How to solve this situation? Thanks in advance

Benjamin Maurer

If you just used the default network settings in the VM it would be NAT with DHCP. This means that you get a LAN IP from the VirtualBox DHCP server and you can't actually access the computer from the outside.

Check out the VirtualBox manual on networking : https://www.virtualbox.org/manual/ch06.html#networkingmodes

I guess bridged mesh seams should be the best. You should configure a static IP address.

EDIT: Edit about removing the "host-only network": it's true that you can't see the VM from the outside. But you get a virtual interface (vboxnetX) on the host. So if you route it through, it should work. The setup is more complex, but the VM is less exposed.

Related


Network access to VirtualBox VM from network PC

Tharik Kanaka Well, I've setup a VM (labeled PC2) in the PC's Virtual Box, and I'm hosting a web service in the VM (IIS). PC2-Windows Server 2003 VM-Windows 7 x86 Now I want to access the web service from another PC (labeled PC1) in the network that PC1 has co

Access PC2's network from virtualbox installed on PC1

Wakan Tanka I'm going to a workshop where I need to bring a laptop with Virtualbox and Windows 7 running in it. My laptop is too old to use Virtualbox with Windows 7 and a native Linux system. So I'm assuming Virtualbox is installed on a (newer) desktop PC and

Access PC2's network from virtualbox installed on PC1

Wakan Tanka I'm going to a workshop where I need to bring a laptop with Virtualbox and Windows 7 running in it. My laptop is too old to use Virtualbox with Windows 7 and a native Linux system. So I'm assuming Virtualbox is installed on a (newer) desktop PC and

Network failure in VirtualBox Guest VM

Best 103 I can't access the internet from a VirtualBox virtual machine on Windows 7 and Debian Linux. I need to fix the problem in order to get these VMs working again. I have a Debian laptop host that has been running VMware VMs in the past and now runs Virtu

Network failure in VirtualBox Guest VM

Best 103 I can't access the internet from a VirtualBox virtual machine on Windows 7 and Debian Linux. I need to fix the problem in order to get these VMs working again. I have a Debian laptop host that has been running VMware VMs in the past and now runs Virtu

Network failure in VirtualBox Guest VM

Best 103 I can't access the internet from a VirtualBox virtual machine on Windows 7 and Debian Linux. I need to fix the problem in order to get these VMs working again. I have a Debian laptop host that has been running VMware VMs in the past and now runs Virtu

From VMWare to VirtualBox - no network

username I used ovftool to convert a VMWare Windows Server 2003 image to OVF. Then I imported it into VirtualBox - works fine, except there is no network connection. I tried NAT, bridged adapter and host only. But in all 3 cases I don't have any network connec

From VMWare to VirtualBox - no network

username I used ovftool to convert a VMWare Windows Server 2003 image to OVF. Then I imported it into VirtualBox - works fine, except there is no network connection. I tried NAT, bridged adapter and host only. But in all 3 cases I don't have any network connec

How to access VirtualBox host-only network from outside the host?

Brian I'm using Vagrant to deploy a large virtual network environment to test some applications and network activity. I'm using host-only networking, so all IP addresses can be defined in the Vagrantfile, but one of the applications I need for testing is an ex

How to access VirtualBox host-only network from outside the host?

Brian I'm using Vagrant to deploy a large virtual network environment to test some applications and network activity. I'm using host-only networking, so all IP addresses can be defined in the Vagrantfile, but one of the applications I need for testing is an ex

VirtualBox: Set the network adapter to be private to the guest VM

Tombstone 89 In the previous question, I asked how to configure m0n0wall in a VM. Now, I want to set up the network adapter in my computer to be used only for the guest VM, that is, to not allow any traffic from the host to go through. So far I haven't been ab

VirtualBox "Bridged Adapter" network not showing up in VM

LMF In short, I'm trying to reroute information from an Android tablet to a CentOS VM on a Windows 7 host. I've set up Virtual Box Manager to have two "Network" adapters (in "Settings"): Adapter 1 is connected to NAT and enabled Adapter 2 is connected to a bri

Network adapter not listed in my virtualbox vm

smile bomb I'm trying to SSH into a virtual machine set up in a virtual machine from a Windows 7 host. I want to make several development machines and create them sshfrom my mainframe and so on. Inside virtualbox, I selected my VM (openSUSE 12.3), then right-c

Network not working on Ubuntu VirtualBox VM created by Packer

dmayo3 I am trying to build a VirtualBox Ubuntu VM with Packer. My image was successfully created and configured to use the Wi-Fi (Mac OS X AirPort) interface for bridged networking. However, after starting the VM, only the loopback interface is set up. EDIT:

VirtualBox: Set the network adapter to be private to the guest VM

Tombstone 89 In the previous question, I asked how to configure m0n0wall in a VM. Now, I want to set up the network adapter in my computer to be used only for the guest VM, that is, to not allow any traffic from the host to go through. So far I haven't been ab

VirtualBox "Bridged Adapter" network not showing up in VM

LMF In short, I'm trying to reroute information from an Android tablet to a CentOS VM on a Windows 7 host. I've set up Virtual Box Manager to have two "Network" adapters (in "Settings"): Adapter 1 is connected to NAT and enabled Adapter 2 is connected to a bri

Network not working on Ubuntu VirtualBox VM created by Packer

dmayo3 I am trying to build a VirtualBox Ubuntu VM with Packer. My image was successfully created and configured to use the Wi-Fi (Mac OS X AirPort) interface for bridged networking. However, after starting the VM, only the loopback interface is set up. EDIT:

Network adapter not listed in my virtualbox vm

smile bomb I'm trying to SSH into a virtual machine set up in a virtual machine from a Windows 7 host. I want to make several development machines and create them sshfrom my mainframe and so on. Inside virtualbox, I selected my VM (openSUSE 12.3), then right-c

MySQL port forwarding and access from any PC outside the network

herobrinebrotherZorro I have created an application that uses mysql and it will be public. I port forwarded the mysql default port on the router and I want anyone to be able to connect to mysql on a computer outside the network. (anyone who can get my app anyw

Can't view or access ubuntu pc in network like this from windows

Mario I can't view my Ubuntu 18.04 PC (acting as a file and media server) from a Windows PC. I have installed Samba, Tasksel, System-config-samba, python-glade2, samba-common, smbclient. Edit avahi-daemon to 0, create "me" and "netguest" users in samba, sudo u

MySQL port forwarding and access from any PC outside the network

herobrinebrotherZorro I have created an application that uses mysql and it will be public. I port forwarded the mysql default port on the router and I want anyone to be able to connect to mysql on a computer outside the network. (anyone who can get my app anyw

Can't view or access ubuntu pc in network like this from windows

Mario I can't view my Ubuntu 18.04 PC (acting as a file and media server) from a Windows PC. I have installed Samba, Tasksel, System-config-samba, python-glade2, samba-common, smbclient. Edit avahi-daemon to 0, create "me" and "netguest" users in samba, sudo u