In order to have the same environment and to keep my working machine clean from the garbage left after such experiments, I do my investigations in a virtualized environment. Usually, my guest operating system (OS) is Ubuntu Server because I usually use this OS in the cloud. Thus, to completely resemble my experience in the cloud I should have terminal access to the guest operating system. Unfortunately, by default after you have installed a guest virtual machine (VM) you do not have network access to it. Therefore, in this article I will show how to configure VirtualBox and guest OSes so that you get access to your virtual machines from the host, e.g., through terminal. So as from time to time my experiments completely broke the system, I should have the possibility to deploy a clean testbed quickly. In order to reach this goal, once a new version of the operating system appears (I prefer to use LTS versions of Ubuntu Server), I download its image and create a new virtual machine where I install the operating system from the downloaded image and make initial configuration. Then, I keep this virtual machine as a template. When I need a new VM for my experiments, I clone this template VM, and I can almost instantly start my investigations. Once I have done with my experiments, I delete this cloned VM in order to free disk space.Īs I do this initial configuration rarely, each time I have to search for instructions in the Internet how to configure network interfaces. So I decided to write this post as a reminder for future myself on how to configure network for my testbed. Problemīy default, VirtualBox creates a NAT network interface for your new virtual machine to enable your guest VM to have access to the Internet. However, in this case you cannot get network access to your virtual machine from your host machine. For instance, you cannot ping it, access it through SSH, or if you develop a client-server application your client running on the host cannot server-side app running in the guest virtual machine. In order to have this possibility, you need to configure network between your Host and Guest VM. So in this article, I explain how to do this in my case. I have to mention that configuration may differ if you have other host and guest environments. I use Kubuntu 18.04 as my host operating system and VirtualBox as a hypervisor. Here, I show how to configure Ubuntu Server 16.04 and Ubuntu Server 18.04 (two most popular LTS versions of Ubuntu Server now), so as the process is different for them. VirtualBox ConfigurationĪfter you have installed Ubuntu Server, shut down your virtual machine, open its “Settings” (select from the menu Machine -> Settings, or press Ctrl+S), and check “Network” configuration. # gateway 192.168.56.1 # if you don't have access to the Internet try to comment this option Iface enp0s8 inet static # we choose IP address manually (static)Īddress 192.168.56.5 # ip address that we have chosen (each VM should have different IP in the 192.168.56.0/24 network) # Secondary interface with static ip (we need to configure this section)Īuto enp0s8 # put the name of the new interface # The primary network interface (it receives address automatically - dhcp) # This file describes the network interfaces available on your system By default, VirtualBox activates one adapter that is attached to NAT. So, for enp0s8 we choose static IP address assignment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |