Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
requirements:

- Internet connection
- Access Host machine from Guest machine
- Access Guest Machine from Host machine 

Requirements

  • Internet connection
  • Access Host machine from Guest machine
  • Access Guest Machine from Host machine
Specs:

host machine: Ubuntu, Virtualbox
guest machine: debian.
wireless interface: wlp2s0
eth adapter: eth1

Specs

Attempt #1host machine: Ubuntu, Virtualbox guest machine: debian. wireless interface: wlp2s0 eth adapter: eth1

Attempt #1

  • Added a NAT adapter to Virtualbox: (10.0.2.0/24, DHCP enabled)

    Added a NAT adapter to Virtualbox: (10.0.2.0/24, DHCP enabled)
  • Added a NAT adapter to the Guest machine.

    Added a NAT adapter to the Guest machine.
  • Configure guest interface:

    Configure guest interface:
    • auto eth1
    • allow-hotplug eth1
    • iface eth1 inet static
    • address 10.0.2.5
    • netmask 255.255.255.0
    • gateway 10.0.2.2
    • network 10.0.2.0
    • broadcast 10.0.2.255
- Internet connection
- Access Host Machine from Guest machine
  • Internet connection
  • Access Host Machine from Guest machine
- Access Guest Machine from Host Machine
  • Access Guest Machine from Host Machine

Attemp #2:Attempt #2

Because sometimes I have to switch from wireless to ethernetEthernet I also tried to configure a bridged adapter for both the network adapters on the Host Machine.

Host Machine IP: 192.168.56.101
Guest Machine IP: 192.168.56.100

Host Machine IP: 192.168.56.101 Guest Machine IP: 192.168.56.100

- Internet connection
- Access Host Machine from Guest machine
  • Internet connection
  • Access Host Machine from Guest machine
- Access Guest Machine from Host Machine
  • Access Guest Machine from Host Machine

This example has a problem because for a bridged connection the host machine IP has to be set in the range of the IP range of the bridged adaperadapter. Sometimes I can't because i am required to use DHCP.

Given the details of my attempts, do you guys can advise me a alternative configuration for achieving my goals?

Thanks for your time. :)

requirements:

- Internet connection
- Access Host machine from Guest machine
- Access Guest Machine from Host machine 
Specs:

host machine: Ubuntu, Virtualbox
guest machine: debian.
wireless interface: wlp2s0
eth adapter: eth1

Attempt #1:

  • Added a NAT adapter to Virtualbox: (10.0.2.0/24, DHCP enabled)

  • Added a NAT adapter to the Guest machine.

  • Configure guest interface:

    • auto eth1
    • allow-hotplug eth1
    • iface eth1 inet static
    • address 10.0.2.5
    • netmask 255.255.255.0
    • gateway 10.0.2.2
    • network 10.0.2.0
    • broadcast 10.0.2.255
- Internet connection
- Access Host Machine from Guest machine
- Access Guest Machine from Host Machine

Attemp #2:

Because sometimes I have to switch from wireless to ethernet I also tried to configure a bridged adapter for both the network adapters on the Host Machine.

Host Machine IP: 192.168.56.101
Guest Machine IP: 192.168.56.100
- Internet connection
- Access Host Machine from Guest machine
- Access Guest Machine from Host Machine

This example has a problem because for a bridged connection the host machine IP has to be set in the range of the IP range of the bridged adaper. Sometimes I can't because i am required to use DHCP.

Given the details of my attempts, do you guys can advise me a alternative configuration for achieving my goals?

Thanks for your time. :)

Requirements

  • Internet connection
  • Access Host machine from Guest machine
  • Access Guest Machine from Host machine

Specs

host machine: Ubuntu, Virtualbox guest machine: debian. wireless interface: wlp2s0 eth adapter: eth1

Attempt #1

  • Added a NAT adapter to Virtualbox: (10.0.2.0/24, DHCP enabled)
  • Added a NAT adapter to the Guest machine.
  • Configure guest interface:
    • auto eth1
    • allow-hotplug eth1
    • iface eth1 inet static
    • address 10.0.2.5
    • netmask 255.255.255.0
    • gateway 10.0.2.2
    • network 10.0.2.0
    • broadcast 10.0.2.255
  • Internet connection
  • Access Host Machine from Guest machine
  • Access Guest Machine from Host Machine

Attempt #2

Because sometimes I have to switch from wireless to Ethernet I also tried to configure a bridged adapter for both the network adapters on the Host Machine.

Host Machine IP: 192.168.56.101 Guest Machine IP: 192.168.56.100

  • Internet connection
  • Access Host Machine from Guest machine
  • Access Guest Machine from Host Machine

This example has a problem because for a bridged connection the host machine IP has to be set in the range of the IP range of the bridged adapter. Sometimes I can't because i am required to use DHCP.

Given the details of my attempts, do you guys can advise me a alternative configuration for achieving my goals?

Post Migrated Here from serverfault.com (revisions)
Source Link
Beach Chicken
  • 299
  • 3
  • 5
  • 13

Virtualbox NAT and host-only connection

Because I'm working on multiple locations, I experience problems with my development servers. Because work on a variety of networks I do not want to configure the networking settings of my virtual machines every time I change network. Sometimes the network requires me to use DHCP. (public libraries and such)

Also I have to change network adapter often, I prefer ethernet but sometimes I have to work wireless.

So a lot of different networks and even different adapters.

requirements:

- Internet connection
- Access Host machine from Guest machine
- Access Guest Machine from Host machine 

I am looking for a configuration so I dont have to change my (virtual machines) network settings. Because I had to changed network (adapter)

Specs:

host machine: Ubuntu, Virtualbox
guest machine: debian.
wireless interface: wlp2s0
eth adapter: eth1

Attempt #1:

Just use NAT.

  • Added a NAT adapter to Virtualbox: (10.0.2.0/24, DHCP enabled)

  • Added a NAT adapter to the Guest machine.

  • Configure guest interface:

    • auto eth1
    • allow-hotplug eth1
    • iface eth1 inet static
    • address 10.0.2.5
    • netmask 255.255.255.0
    • gateway 10.0.2.2
    • network 10.0.2.0
    • broadcast 10.0.2.255

With this configuration the following works:

- Internet connection
- Access Host Machine from Guest machine

With this configuration, the following does not work:

- Access Guest Machine from Host Machine

This seems to be a limitation when using NAT.

Attemp #2:

NAT in combination with Bridged connection:

  • Virtualbox NAT Adapter (10.0.2.0/24, DHCP enabled)
  • Virtualbox Bridged Adapter (192.168.56.1/24, DHCP enabled)

Because sometimes I have to switch from wireless to ethernet I also tried to configure a bridged adapter for both the network adapters on the Host Machine.

Host Machine IP: 192.168.56.101
Guest Machine IP: 192.168.56.100

With this configuration, the following does work:

- Internet connection
- Access Host Machine from Guest machine

With this configuration, the following does not work:

- Access Guest Machine from Host Machine

This example has a problem because for a bridged connection the host machine IP has to be set in the range of the IP range of the bridged adaper. Sometimes I can't because i am required to use DHCP.

Given the details of my attempts, do you guys can advise me a alternative configuration for achieving my goals?

Thanks for your time. :)