# Create Ubuntu 16.04 VM Image from Scratch

If you wish to run Ubuntu 16.04 virtual machines on your Platform9 OpenStack cloud today, you have two options to get a Ubuntu 16.04 Image in your image catalog to get started:

* Download Ubuntu 16.04 LTS cloud image from the Ubuntu official website [here](https://cloud-images.ubuntu.com/xenial/current/).
* Create a new Ubuntu 16.04 LTS image from scratch

Option 1 is the easiest, but is tricky because Ubuntu 16.04 cloud image comes prepackaged with an existing cloud-init which is known to have issues as covered by our [tutorial here](https://docs.platform9.com/managed-openstack/5.4/images/images-prepare-ubuntu-image).

(Also see here on what you need to do to configure default password for this image if using virt-manager: <https://gist.github.com/smoser/4756561>)

Hence, option 2 is the best option. Option 2 involves installing Ubuntu image on a brand new virtual machine using virt-manager and customize it to your taste. This tutorial describes just how to do that.

### Step 1 - Download Ubuntu 16.04 LTS ISO

As a first step, fetch the Ubuntu image suitable to your platform.

{% tabs %}
{% tab title="Bash" %}

```bash
cd /var/lib/libvirt/images
wget http://releases.ubuntu.com/xenial/ubuntu-16.04.3-server-amd64.iso
```

{% endtab %}
{% endtabs %}

### Step 2 - Create a virtual machine

Fire up your virt-manager and create a new virtual machine. Pick the ISO you just downloaded. Use OS type = Linux, Version = Ubuntu 16.04 LTS (Xenial Xerus)

<figure><img src="https://1126553421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8EciOmTwpkZCkUOCYd9%2Fuploads%2Fgit-blob-0a5138f5cca56a61904ca775d6f692665a06891a%2F1605291606.png?alt=media" alt=""><figcaption></figcaption></figure>

### Step 3 - Follow Ubuntu Installation Steps

Follow the usual steps of installation for Ubuntu, and at the least pick Open SSH Server under components.

### Step 4 - Set 'nomodeset' Grub Option

Open /etc/default/grub (See <http://ubuntuforums.org/showthread.php?t=1613132> for more details)

Edit line **`GRUB_CMDLINE_LINUX_DEFAULT`** and add **nomodeset** to it

<figure><img src="https://1126553421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8EciOmTwpkZCkUOCYd9%2Fuploads%2Fgit-blob-831be6b4a58a92247c5276bc1a9ca454b74e8e79%2F1605291629.png?alt=media" alt=""><figcaption></figcaption></figure>

### Step 5 - Run Grub Update

{% tabs %}
{% tab title="Bash" %}

```bash
sudo update-grub
```

{% endtab %}
{% endtabs %}

### Step 6 - Install the Platform9 Cloud-init Package

Get the .deb file from [here](https://docs.platform9.com/managed-openstack/5.4/images/images-prepare-ubuntu-image). Install it in your Virtual Machine.

{% tabs %}
{% tab title="Bash" %}

```bash
dpkg -i cloud-init_0.6.3-0ubuntu1.15_all.deb
```

{% endtab %}
{% endtabs %}

### Step 7 - Your Image Is Ready

At this point, you can use the virtual machine disk for creating new virtual machines.
