In the previous article “Installing an Ubuntu Core System,” we covered how to install Ubuntu Core 16 on KVM and ARM devices. In today’s tutorial, we’ll show you how to install Ubuntu Core using Virtualbox. In some cases, this may be a more convenient approach than KVM.

\

1) Download VirtualBox and install it

\

We can do it at the following address:

\

www.virtualbox.org/wiki/Linux_… \

\

Download the latest Virtualbox Debian package. Once the download is complete, we can double click the downloaded.deb file and have our Ubuntu Store app install it for us:

\

\

\

\

\

2) Download Ubuntu Core Image

\

We can download the latest Ubuntu Core 16 image at the following address:

\

Releases.ubuntu.com/ubuntu-core… \

\

You can download the Ubuntu Core file directly from this page. We can also type the following command in our terminal:

\

$ wget http://releases.ubuntu.com/ubuntu-core/16/ubuntu-core-16-amd64.img.xz
$ unxz ubuntu-core-16-amd64.img.xz
Copy the code

\

Note that we downloaded the 64-bit version above. Developers can download the corresponding version based on their CPU bits.

We downloaded a raw disk image. In order for VirtualBox to use it, we must use the following command to convert it to a VDI:

\

$ VBoxManage convertdd ubuntu-core-16-amd64.img ubuntu-core-16-amd64.vdi --format VDI
Copy the code

\

The following files appear in our file directory:

\

liuxg@liuxg:~/snappy/desktop/images1$ ls -alh
total 775M
drwxrwxr-x   2 liuxg liuxg 4.0K 11月 22 13:34 .
drwxrwxr-x 115 liuxg liuxg 4.0K 11月 22 13:32 ..
-rw-rw-r--   1 liuxg liuxg 3.7G 11月  3 23:16 ubuntu-core-16-amd64.img
-rw-------   1 liuxg liuxg 402M 11月 22 14:04 ubuntu-core-16-amd64.vdi
Copy the code

We see that a new file ubuntu-core-16-amd64.vdi has been produced.

\

\

3) Create an Ubuntu Core instance in VirtualBox

\

We launched our VirtualBox in dash on Desktop:

\

\

\

After VirtualBox starts up, we start our configuration:

\

     \

\

\

\

When we click the Create button, it may display the following error message:

\

\

\

This is because we didn’t run the following command:

\

$ sudo /sbin/vboxconfig
Copy the code

\

If the following error occurs while running the above command:

\

\

As prompted on AskUbuntu, we need to disable our secure Boot in our BIOS first. Specific how to operate, we have to set up according to their BIOS. After the configuration is complete, run the preceding command until it succeeds.

\

\

\

Let’s configure our Ubuntu Core 16:

\

       \

\

   \

\

At this point, we’ve set up our Ubuntu Core.

\

\

4) Login to Ubuntu Core 16

\

Above we have set up our Ubuntu Core 16. Next, let’s configure our VirtualBox so that we can log into the Ubuntu Core. Let’s start by opening our VirtualBox

\

    \

\

\

\

After the above configuration, we redirected the Ubuntu Core 22 port address in VirtualBox to the 10022 port address. Let’s launch our Ubuntu Core next:

\

\

\

This way we can see that our Ubuntu Core has started.

\

\ \

We can log in to Ubuntu Core by typing the following command in our terminal:

\

\

\

\

At this point, we have finished configuring VirtualBox.

\

\