{"id":4360,"date":"2025-12-01T19:51:46","date_gmt":"2025-12-01T19:51:46","guid":{"rendered":"https:\/\/m0aws.co.uk\/?p=4360"},"modified":"2025-12-02T11:52:48","modified_gmt":"2025-12-02T11:52:48","slug":"virtual-machines-on-raspberrypi-5","status":"publish","type":"post","link":"https:\/\/m0aws.co.uk\/?p=4360","title":{"rendered":"Virtual Machines on RaspberryPi 5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">RaspberryPi computers are now moving into the realm of being powerful enough to replace the traditional desktop PC. My most recent purchase, a RaspberryPi 500+ is proof of this as it has been my daily desktop PC since it&#8217;s arrival.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of the things I use heavily are virtual machines. They&#8217;re great for developing, prototyping and running new services. With the ability to snapshot, rollback and backup in an instant, virtualisation helps to reduce the development and test time for many of the programs and services that I&#8217;m playing with.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With RaspberryPi computers now supporting 16GB of RAM and M.2 SSD drives there is no reason for not taking advantage of virtualisation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To this end I decided to test running some virtualised loads on my new 500+ with the plan to deploy to 16GB Pi5&#8217;s with SSD drives in place of more expensive Intel based computers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On my Intel based machines I use QEMU, KVM and Virt-Manager to manage the multitude of virtual machines (VMs) I have running here. Since this is a solid, high performance platform for running VMs I decided to take the same route on the 500+<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the necessary packages is extremely simple, just one simple apt command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients virt-manager bridge-utils<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> <em>If you&#8217;re using Debian 13 (Trixie) then the apt command to use is:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install qemu-system-arm libvirt-daemon-system libvirt-clients virt-manager bridge-utils<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The qemu-kvm package doesn&#8217;t exist in Debian 13 and so you have to replace it with the qemu-system-arm package.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To be able to create and run VMs you need to add yourself to the <em>libvirt<\/em> and <em>libvirt-qemu<\/em> groups.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -a -G libvirt your_username\nsudo usermod -a -G libvirt-qemu your_username<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Of course you can do it the old-fashioned way by editing the \/etc\/group file and adding your username to each group.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll need to create a bridged ethernet device for the VMs to use to access the ethernet interface on your RaspberryPi.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If like me you <a href=\"https:\/\/m0aws.co.uk\/?p=4303\" target=\"_blank\" rel=\"noreferrer noopener\">don&#8217;t use NetworkManager<\/a> the easiest way to create a bridge is to define it in your <em><strong>\/etc\/network\/interfaces<\/strong><\/em> file. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this example I am using an IP Address of 192.168.0.100, gateway on 192.168.0.1 with a netmask of 255.255.255.0 and DNS nameserver on 192.168.0.5.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The normal entry in the interfaces file would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Main ethernet\nauto eth0\niface eth0 inet static\naddress 192.168.0.100\nnetmask 255.255.255.0\ngateway 192.168.0.1\ndns-nameservers 192.168.0.5\ndns-domain lan.local\ndns-search lan.local\n#\n#<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To create a bridge this entry needs to change to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Main ethernet\n# Setup Bridge called br1 on eth0\nallow-hotplug eth0\niface eth0 inet manual\nauto br1\niface br1 inet static\naddress 192.168.0.100\nnetwork 192.168.0.0\nnetmask 255.255.255.0\nbroadcast 192.168.0.255\ngateway 192.168.0.1\ndns-nameservers 192.168.0.5\nbridge_ports eth0\nbridge_stp off\n#\n#<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once this is done reboot your RaspberryPi and check you have access to your local LAN and of course the internet. You will now also inherit the two new groups that you added yourself to above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note: <\/strong><em>If you are using NetworkManager open the network settings app and create a bridge on eth0. You can also use the nmtui copmmandline app if you prefer.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this point you&#8217;re ready to create your first virtual machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s important to have an arm64 version of Linux in ISO format that you can use to install into your VM. My preferred distro is Debian and so I downloaded the Debian 13 Arm64 netinst ISO from the <a href=\"https:\/\/cdimage.debian.org\/debian-cd\/13.2.0\/arm64\/iso-cd\/\" target=\"_blank\" rel=\"noreferrer noopener\">debian.org website<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the main menu start &#8220;Virtual machine Manager&#8221; or on the commandline type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>virt-manager<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"709\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-mananger.png\" alt=\"QEMU Virtual Machine Manager\" class=\"wp-image-4385\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-mananger.png 680w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-mananger-288x300.png 288w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><figcaption class=\"wp-element-caption\">QEMU Virtual Machine Manager<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click the Create new VM button and then navigate to where you saved your ISO file and select it as the installation media.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"659\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-create-new-VM.png\" alt=\"Virtual Machine Manager - Local install media\" class=\"wp-image-4387\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-create-new-VM.png 630w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-create-new-VM-287x300.png 287w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Local install media<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"659\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-ISO-Select.png\" alt=\"Virtual Machine Manager - Select ISO file\" class=\"wp-image-4386\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-ISO-Select.png 880w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-ISO-Select-300x225.png 300w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-man-ISO-Select-768x575.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Select ISO file<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve chosen your ISO you&#8217;ll need to configure the actual VM. Start by setting the amount of RAM and number of virtual CPUs you want the VM to have.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"659\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-RAM-CPU.png\" alt=\"Virtual Machine Manager - Configure RAM and CPU\" class=\"wp-image-4393\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-RAM-CPU.png 630w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-RAM-CPU-287x300.png 287w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Configure RAM and CPU<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next set the size of the virtual disk that the VM will use.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"659\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-disk.png\" alt=\"Virtual Machine Manager - Create virtual disk\" class=\"wp-image-4392\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-disk.png 630w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-disk-287x300.png 287w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Create virtual disk<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, give the VM a name and set its network device to br0 as created above. Click finish and your VM will boot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"659\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-VM-name-network.png\" alt=\"Virtual Machine Manager - Name VM and select bridge interface\" class=\"wp-image-4391\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-VM-name-network.png 630w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-VM-name-network-287x300.png 287w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Name VM and select bridge interface<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now it&#8217;s just a case of going through the standard Debian install process to build your Debian VM.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1154\" height=\"1005\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-OS-install.png\" alt=\"Virtual Machine Manager - Boot ISO\" class=\"wp-image-4390\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-OS-install.png 1154w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-OS-install-300x261.png 300w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-OS-install-768x669.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Boot ISO<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1154\" height=\"1005\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-installing-OS.png\" alt=\"Virtual machine Manager - Running standard Debian install\" class=\"wp-image-4389\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-installing-OS.png 1154w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-installing-OS-300x261.png 300w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-installing-OS-768x669.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Virtual machine Manager &#8211; Running standard Debian install<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once the installation is complete and the VM has rebooted you will have a functional Debian computer ready to use for whatever you like, just like a physical PC but, in virtual form. You&#8217;ll find that the VM runs as fast as the actual physical machine thanks to the kernel based virtualisation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1154\" height=\"1005\" src=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-top.png\" alt=\"Virtual Machine Manager - Running VM\" class=\"wp-image-4396\" srcset=\"https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-top.png 1154w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-top-300x261.png 300w, https:\/\/m0aws.co.uk\/wp-content\/uploads\/2025\/12\/virt-manager-top-768x669.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Virtual Machine Manager &#8211; Running VM<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For more information on Virtual Machine Manager take a look at the <a href=\"https:\/\/documentation.ubuntu.com\/server\/how-to\/virtualisation\/virtual-machine-manager\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu Server documentation.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More soon &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RaspberryPi computers are now moving into the realm of being powerful enough to replace the traditional desktop PC. My most recent purchase, a RaspberryPi 500+ is proof of this as it has been my daily desktop PC since it&#8217;s arrival. One of the things I use heavily are virtual machines. They&#8217;re great for developing, prototyping &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/m0aws.co.uk\/?p=4360\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Virtual Machines on RaspberryPi 5&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[500,518,523,522,371,531,530,36,512,287,510,132,4,499,375,353,521,528,529,38,495,497,135,411,492,519,520,122,487,524,525,526,527],"tags":[],"class_list":["post-4360","post","type-post","status-publish","format-standard","hentry","category-etc-network-interfaces","category-apt","category-arm","category-arm64","category-backup","category-bridge","category-bridge-utils","category-code","category-coding","category-commandline","category-cpu","category-debian","category-ham-radio","category-interfaces","category-internet","category-iso","category-kvm","category-libvirt","category-libvirt-qemu","category-linux","category-networkmanager","category-networkmangler","category-opensource","category-pi-5","category-pi500","category-pi500-2","category-qemu","category-raspberrypi","category-raspberrypi500","category-virtualisation","category-virtualization","category-virtualmachine","category-vm"],"_links":{"self":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4360"}],"version-history":[{"count":34,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4360\/revisions"}],"predecessor-version":[{"id":4405,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4360\/revisions\/4405"}],"wp:attachment":[{"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/m0aws.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}