IP Address Ubuntu Server Not Available In VirtualBox

Posted on

IP Address Ubuntu Server

IP Address Ubuntu Server Not Available In VirtualBox – Ubuntu Server is the best server in the world. It’s free and open source.

If you wanto to instal Ubuntu Server 20.04, system requirements is:

  • CPU: 1 gigahertz or better
  • RAM: 1 gigabyte or more
  • Disk: a minimum of 2.5 gigabytes

This version supports four 64-bit architectures:

  • amd64 (Intel/AMD 64-bit)
  • arm64 (64-bit ARM)
  • ppc64el (POWER8 and POWER9)
  • s390x (IBM Z and LinuxONE)

When I first installed ubuntu server, I couldn’t find the IP address of the server I installed in virtualbox, so I couldn’t access from my computer to the server that was installed in virtualbox.

the IP address that appears when I do ifconfig is “10.0.2.15”. This is not accessible. So I searched for this problem and managed to find a solution.

For example when I want to see the IP address of the server it comes out like this:

server@server:~$ ifconfig
enpos3: flags=4163<UP, BROADCAST, RUNNING ,MULTICAST> mtu 1500
              inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
              inet6 fe80::200:27ff:fe29:f7a2 prefixlen 64 scopeid ox20<link>
              ether 08:00:27:29:f7:a2 txqueuelen 1000 (Ethernet)
              RX packets 2439 bytes 3378017 (3.3 MB)
              RX errors o dropped o overruns 0 frame o
              TX packets 710 bytes 64275 (64.2 KB) 
              Tx errors o dropped o overruns o carrier o collisions o

lo: flags=73<UP, LOOPBACK, RUNNING> mtu 65536
              inet 127.0.0.1 netmask 255.0.0.0
              inet6 ::1 prefixlen 128 scopeid Ox10<host>
              loop txqueuelen 1000 (Local Loopback)
              RX packets 200 bytes 15664 (15.6 KB)
              RX errors o dropped overruns 0 frame o
              TX packets 200 bytes 15664 (15.6 KB)
              TX errors 0 dropped 0 overruns carrier 0 collisions o

After I find out, This happens because we have not set Host Network. So to fix this, we first set the network to Host Network.

Get Server IP

To get Server IP in virtual box, follow this steps:

  • Back to VirtualBox Manager
  • Click the File menu -> Host Network Manager
  • Click “Create” then a network and its IP will be created.
  • Checklist or enable DHCP Server
IP Address Ubuntu Server Not Available In VirtualBox
  • Enter the Settings Menu
  • Select the Network menu
  • Change NAT to Host-only Adapter with the netwok options that we have made like this
IP Address Ubuntu Server Not Available In VirtualBox
  • Log back into the server, then type ifconfig
  • Then the IP address will appear:
serverserver: $ ifconfig
enpos3: flags=4163<UP, BROADCAST, RUNNING, MULTICAST> mtu 1500
               inet 192.168.56.101 netmask 255.255.255.0 broadcast 192.168.56.255
               inet6 fe80::a00:27ff:fe29:f7a2 prefixlen 64 scopeid ox20<link>
               ether 08:00:27:29:f7:a2 txqueuelen 1000 (Ethernet)
               RX packets 2442 bytes 3379787 (3.3 MB)
               RX errors o dropped o overruns o frame 0
               TX packets 725 bytes 66175 (66.1 KB)
               Tx errors o dropped o overruns o carrier o collisions o
lo: flags=73<UP, LOOPBACK, RUNNING> mtu 65536
               inet 127.0.0.1 netmask 255.0.0.0
               inet6 ::1 prefixlen 128 scopeid Ox10<host>
               loop txqueuelen 1000 (Local Loopback)
               RX packets 232 bytes 17936 (17.9 KB)
               RX errors o dropped o overruns 0 frame 0
               TX packets 232 bytes 17936 (17.9 KB)
               TX errors o dropped o overruns O carrier 0 collisions O
  • IP that has been assigned is 192.168.56.101
  • Finished

Now the IP is there. If you can’t access the IP address of your computer, chances are you haven’t installed apache2. Do it using the following command:

sudo apt install apache2 openssh-server

If everything is correct, then when we access the IP it will appear like this:

IP Address Ubuntu Server Not Available In VirtualBox

Hopefully this article is useful for you.

1 comment

Leave a Reply