{"id":197,"date":"2020-09-26T13:23:45","date_gmt":"2020-09-26T13:23:45","guid":{"rendered":"https:\/\/dft.wiki\/?p=197"},"modified":"2024-08-16T16:29:00","modified_gmt":"2024-08-16T20:29:00","slug":"how-to-use-muiltipass","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=197","title":{"rendered":"Disposable Dev\/Test Env with MuiltiPass"},"content":{"rendered":"<p><strong>Multipass<\/strong> [<a href=\"https:\/\/multipass.run\/\">Link<\/a>] is not a Hypervisor, it is a tool to quickly and easily start fresh Ubuntu VMs (Virtual Machines) using the Native hypervisor of the OS (Operations System) or LXC in on Linux (very much recommended).<\/p>\n<p>This is a straightforward tool for launching disposable instances for developments and tests but is not recommended for production except for non-mission critical workloads.<\/p>\n<p>Find out more info in this post about <strong>Snap vs Docker vs Multipass<\/strong> [<a href=\"https:\/\/dft.wiki\/?p=189\">Link<\/a>].<\/p>\n<hr \/>\n<p><strong>INSTALLING<\/strong><\/p>\n<pre>sudo apt update\r\nsudo apt install snapd\r\nsudo snap install multipass --classic<\/pre>\n<p>It is recommended for Linux systems to have LXD installed so it deploys system containers instead of visual machines:<\/p>\n<pre>sudo snap install lxd\r\nsudo snap connect multipass:lxd lxd\r\nsudo multipass set local.driver=lxd<\/pre>\n<hr \/>\n<p><strong>GUI<\/strong><\/p>\n<p>The graphic user interface was released in late July 2024. It provides a pretty good (and visual) user experience.<\/p>\n<p>See the example below what the home page looks like.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-4352\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-25-32-1024x650.png\" alt=\"\" width=\"640\" height=\"406\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-25-32-1024x650.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-25-32-300x190.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-25-32-768x487.png 768w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-25-32.png 1452w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>By clicking on the settings button (gear icon) a custom name and values for CPU, RAM, and Disk size can be tweaked.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-4353\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-28-1024x650.png\" alt=\"\" width=\"640\" height=\"406\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-28-1024x650.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-28-300x190.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-28-768x487.png 768w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-28.png 1452w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>The &#8220;Launch&#8221; button will take care of everything and the progress is way better than the CLI experience.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-4354\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-49-1024x183.png\" alt=\"\" width=\"640\" height=\"114\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-49-1024x183.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-49-300x54.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-49-768x137.png 768w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-34-49.png 1452w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Voil\u00e0!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-4355\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-37-07-1024x650.png\" alt=\"\" width=\"640\" height=\"406\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-37-07-1024x650.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-37-07-300x190.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-37-07-768x487.png 768w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-08-09-09-37-07.png 1452w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>The &#8220;Actions&#8221; menu contains the basic controls of the instance for starting, stopping, suspending, and discarding (deleting).<\/p>\n<hr \/>\n<p><strong>USING<\/strong><\/p>\n<p><strong>Searching for Images<\/strong><\/p>\n<pre>multipass find<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4258\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-33-19.png\" alt=\"\" width=\"979\" height=\"337\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-33-19.png 979w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-33-19-300x103.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-33-19-768x264.png 768w\" sizes=\"auto, (max-width: 979px) 100vw, 979px\" \/><\/p>\n<p>Guess what? There is only images of Ubuntu. What a surprise!<\/p>\n<p><strong>Launching Instance &#8211;\u00a0 Automatically downloads and runs.<\/strong><\/p>\n<pre>multipass launch lts --name web-server\r\nmultipass launch jammy --name ftp-server\r\nmultipass launch 20.04 --name db-server<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4259\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-41-56.png\" alt=\"\" width=\"410\" height=\"156\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-41-56.png 410w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-41-56-300x114.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/p>\n<ul>\n<li>Optional Parameters\n<ul>\n<li><strong>&#8211;cpu<\/strong> 2<\/li>\n<li><strong>&#8211;mem<\/strong> 2G<\/li>\n<li><strong>&#8211;disk<\/strong> 20G<\/li>\n<li><strong>&#8211;mount<\/strong> \/Host_Pat\u00adh:\/Guest_Path<\/li>\n<li><strong>&#8211;bridged<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Gathering Information<\/strong><\/p>\n<pre>multipass list\r\nmultipass info<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4260\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-42-48.png\" alt=\"\" width=\"755\" height=\"180\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-42-48.png 755w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-42-48-300x72.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4261\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-43-36.png\" alt=\"\" width=\"489\" height=\"797\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-43-36.png 489w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-43-36-184x300.png 184w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/p>\n<figure class=\"wp-block-image size-large\"><\/figure>\n<p><strong>Executing Commands and Getting Shells<\/strong><\/p>\n<pre>multipass exec web-server -- lsb_release -a\r\nmultipass exec ftp-server -- cat \/etc\/os-release\r\nmultipass shell db-server<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4262\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-45-14.png\" alt=\"\" width=\"834\" height=\"447\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-45-14.png 834w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-45-14-300x161.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-04-08-45-14-768x412.png 768w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/p>\n<figure class=\"wp-block-image size-large\"><\/figure>\n<p><strong>Managing Instances<\/strong><\/p>\n<p>Operating<\/p>\n<pre>multipass stop web-server ftp-server\r\nmultipass start web-server\r\nmultipass delete web-server db-server\r\nmultipass purge<\/pre>\n<p>Modifying<\/p>\n<pre>multipass stop<strong> ftp-server<\/strong>\r\nmultipass set local.<strong>ftp-server<\/strong>.cpus=4\r\nmultipass set local.<strong>ftp-server<\/strong>.disk=50G\r\nmultipass set local.<strong>ftp-server<\/strong>.memory=4G<\/pre>\n<p>Backups and Snapshots<\/p>\n<pre>multipass snapshot <strong>ftp-server<\/strong>\r\nmultipass list --snapshots\r\nmultipass restore <strong>ftp-server.snapshot1\r\n<\/strong>multipass delete <strong>ftp-server.snapshot1<\/strong><\/pre>\n<p>Creating Aliases<\/p>\n<p>Alias is a great feature that allow running commands inside a guest as if they were on the host.<\/p>\n<pre>multipass alias ftp-server:htop\r\nhtop<\/pre>\n<pre>multipass aliases\r\nmultipass unalias htop\r\nmultipass unalias --all<\/pre>\n<p><strong>Configuring Bridge<\/strong><\/p>\n<pre>multipass networks\r\nmultipass set local.driver=virtualbox\r\nmultipass set local.bridged-network=en0<\/pre>\n<p><strong>Note:<\/strong> the first command will set the driver Multipass will use to communicate with the network adapters. On MacOS it used VirtualBox&#8217;s drivers. The second command will inform what is the bridge attached to (on MacOS <code>en0<\/code> is Wi-Fi, and <code>en1<\/code> is Ethernet).<\/p>\n<p><strong>Taskbar Integration<\/strong><\/p>\n<p>Deploy a new instance with literally a single click:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4268\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-05-16-21-12.png\" alt=\"\" width=\"333\" height=\"270\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-05-16-21-12.png 333w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/Screenshot-from-2024-05-05-16-21-12-300x243.png 300w\" sizes=\"auto, (max-width: 333px) 100vw, 333px\" \/><\/p>\n<p><strong>Uninstalling Multipass<\/strong><\/p>\n<pre>sudo snap remove multipass<\/pre>\n<p><strong>Good luck with your projects!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Multipass [Link] is not a Hypervisor, it is a tool to quickly and easily start [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=197"}],"version-history":[{"count":12,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":4366,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/197\/revisions\/4366"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}