0

How do I configure a VirtualBox appliance to have its own I.P. address when running on a host Ubuntu machine?

I've tried following the solution for this question but am not having any luck: Getting I.P address of Ubuntu Server running in Virtual Box

Thanks in advance.

Fuzzy Analysis
  • 398
  • 1
  • 6
  • 12

1 Answers1

1

Configure your virtual machine adapter as Bridged Adapter.

Boot into your Ubuntu VM and run following command to get your IP address.

hostname -I

Now you can use ssh to access your server with that IP address or open-up website from your browser if you're running any web server.

If you want to add local network to your server aswell, then add Network Adapter 2 as Internal Network

Edit /etc/network/interfaces and add static adapter as eth1

auto eth1
    iface eth1 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    gateway 192.168.0.0

When this is done, bring your adapter up.

ifup eth1
Gen
  • 933
  • 1
    Thanks. I found another way via "Host-Only Adapter" as well. File -> Preferences -> Network -> "Host-Only", "+" (adds the new i.p. address called 'vboxnet0' by default). – Fuzzy Analysis Apr 17 '16 at 10:16