We will walk you through the steps of installing Ubuntu Core 20 on your Linux desktop in a virtual machine.
-Uncompress the image with the following command:
-unxz ubuntu-core-20-amd64.img.xz
- Install the qemu-kvm package with the following command:
-sudo apt install qemu-kvm ovmf
- Then, run the kvm-ok command to check KVM status and your hardware:
-kvm-ok
- The message should say:
-INFO: /dev/kvm exists
-KVM acceleration can be used
- This is the best outcome — it means that Ubuntu Core will run fast on your system, taking advantage of hardware acceleration in your CPU.
-You can now launch a virtual machine with KVM, using the following command:
-qemu-system-x86_64 -smp 2 -m 2048 -net nic,model=virtio -net user,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -vga qxl -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=ubuntu-core-20-amd64.img,cache=none,format=raw,id=disk1,if=none -device virtio-blk-pci,drive=disk1,bootindex=1 -machine accel=kvm
- - Note: this command sets up port redirections: -
localhost:8022
is redirecting to port 22
of the virtual machine for accessing it through SSHlocalhost:8090
is redirecting to its port 80
- Note: this command is required for graphics such as mir-kiosk: -
-vga qxl
sets the paravirtual graphics driver qxlYou should now see a window, with your Ubuntu Core virtual machine booting inside it.
-Once setup is done, you can login with SSH into Ubuntu Core, using the following command:
-ssh -p 8022 <Ubuntu SSO user name>@localhost
- Your username is your Ubuntu SSO user name, shown to you at the end of the account configuration step.
-