Linux Fu: Easy VMs

It wasn’t long ago that we looked at easily creating Docker containers from the command line so you could just easily spin up a virtual environment for development. Wouldn’t it be nice if you could do the same for virtual machines? You can. Using Multipass from Canonical, the makers of Ubuntu, you can easily spin up virtual machines under Linux, Mac, or Windows. Granted, most of the virtual machines in question are variations of Ubuntu, but there are some additional images available, and you can create your own.


Once you have it installed, starting up a new Ubuntu instance is trivial. If you have a set configuration, you can even set up predefined setups using a YAML file.



Installation


The process varies by platform, but on Ubuntu, installing Multipass is as easy as:


sudo snap install multipass

You should be sure that you are on a computer that can support virtual machines. The /proc/cpuinfo file should have a vmx or svm flag (actually, several of them; one for each core).


Catalog


You can see all the images available by running:


multipass find

Naturally, most of the images are Ubuntu versions, although there are a few other appliances like anbox and nextcloud available.


Suppose you want to do some testing in a Ubuntu bionic (18.04) instance. You can launch a default instance by issuing the command:


multipass launch bionic

However, you usually want a little more control since the default is one CPU core, a gigabyte of RAM, and 5G of disk storage. Say you want 4 CPUs, 6G of RAM, and a 10G disk. You can also provide a name for ..

Support the originator by clicking the read the rest link below.