reset password

Set Up Ubuntu Server to Host VMs

Download and install Ubuntu Server 16.04 LTS. During installation, select the following options:

  • Mail Server
  • Standard System Utilities
  • Virtual Machine Host
  • OpenSSH Server

After installation, use apt-get to install the following packages:

  • virtinst
  • libosinfo-bin

1. Create a Virtual Machine

Download an ISO image, e.g.

>  wget http://releases.ubuntu.com/16.04.4/ubuntu-16.04.4-server-amd64.iso

Create a config file like sd2018-ubuntu-server.cfg which specifies the parameters of the VM. Run the script createvm.sh to create the VM. For example:

> createvm.sh sd2018-ubuntu-server.cfg

The VM tool will create a VNC session to provide a GUI so we can complete the installation of the guest OS. First, open another terminal and run the following command to find out the port of the VNC session:

> virsh dumpxml <name> | grep vnc

where <name> is the name of the VM specified in the config file. And then, connect to the VNC session using a VNC viewer (e.g. TightVNCfrom a different computer -- we need a GUI to run a VNC viewer, and the Ubuntu Server we use to host VMs does not have one. After the OS installation is completed, the VM will be restarted, and you can connect to it at the same port using VNC.

 

 

This page has been viewed 14839 times.