Banner of Host-Only Network: Access Local Websites in VirtualBox

Access Local Websites: Linux to Windows in VirtualBox

Category: Linux

Date: 2 months ago
Views: 183

How to Access a Local Website from a Linux Host Machine to a Windows Guest Machine in VirtualBox

If you're running a Windows virtual machine (VM) inside VirtualBox on your Linux host, you might want to access a local website or service hosted on the guest machine. In this guide, we'll walk through the steps to set up communication between your Linux host and Windows guest using a host-only network.


VirtualBox: Ensure that you have VirtualBox installed on your Linux host machine.

Windows Guest VM: Set up a Windows virtual machine in VirtualBox.


1. Create a Host-Only Network in VirtualBox:

• Open VirtualBox and go to File > Host Network Manager.

VirtualBox Network Manager
VirtualBox Network Manager

• In the Host-Only Networks tab, click Create. A host-only network will be created with the default name "vboxnet0".

Host-Only Network Creation
Host-Only Network Creation

• By default, it will have an IPv4 prefix of and DHCP enabled.

2. Configure the Virtual Machine Settings:

• Open the settings for your Windows guest virtual machine.

• Keep the first network adapter (usually NAT) as it is.

• Enable the second network adapter and select Attached to: "Host-Only Adapter".

• Choose the network name "vboxnet0" (the one you created in step 1).

Host-Only Adapter
Host-Only Network Adapter

3. Start Your Virtual Machine:

• Now, whenever you run your Windows guest virtual machine, it will be connected to the host-only network.

• On the host machine (Linux), you'll find a local network for communication between the host and guest machines. in my case I got something like this

$ ip a | grep -oP '(?<=inet |addr:)(?:\d+\.){3}\d+'	# loopback adress	# my machine local IP adress in my Local network	# this is the IP address of the host-only network	# my machine IP adress in the host-only network

If I have a website running in my Linux (host) machine on port 8081 then I can access it in the guest VM like this or or when I am connected to a local network


Previous Article Next Article

0 Comments, latest

No comments.