Armbian the Virtual Machine


lanefu
 Share

2 2

Recommended Posts

Posted (edited)

Been dreaming of this one for a while.  Finally got a weekend to focus on it recently.  I'm hoping someone is eager to take what I've done and move It along some more.

Here's what we have so far.

* a linux 'family' called virtual.conf

* a kernel config called linux-virtual-current.config

* a board called virtual-qemu.wip

 

The result is a full HVM accelerated armbian image with a kernel compiled with all the virtio drivers for disk, network and video.   Also a u-boot.bin made for qemu that can boot the image when used as the qemu bios/firmware

 

I've ran it as a VM on ubuntu using plain qemu on a Ampere eMag box.. and using UTM (qemu) on Apple M1 in MacOS

this is using u-boot, not uEFI.. and you need to copy the u-boot.bin manually from cache/sources/u-boot...../u-boot.bin and use it as your chosen bios for qemu.  I left some quick breadcrumbs on how to launch within the board config file.

 

I want to keep the u-boot option, but obviously we need this to support uEFI booting to be viable for the masses.

Next steps:

* automatically resize and convert resulting image to qcow2 format

* solve how to add cloud-init to image

* solve for installing grubEFI for booting and whatever partition layout is needed

* figure a proper way to write uboot to the image so thet qemu can boot without loading as a bios

* strip extra hardware drivers out of kernel and make this thing lean


PS Did I mention Desktop Works too?
image.png
 

 

 

Edited by lanefu
qcow2 image now produced
Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

For those wondering Why?

Here's several possible reasons

 

  • because we can
  • better opportunities for automated testing of changes
  • faster manual testing
  • easier to test desktop builds (I actually hate flashing sdcard and having to touch hardware)
  • Broaden visibility of armbian as a platform for compute
Link to post
Share on other sites

10 hours ago, why2 said:

@lanefu awesome work and well done! What can I do with the wip file?
I would like to try your work. Do you have any step-by-step guide to start the Armbian VM?


the WIP file is for building with the armbian build tools...  I have some crappy tips in there for qemu.

okay so here's a really quick n dirty 

 

download UTM for Mac 

Download zip and extract.  this UTM config https://armbian.lane-fu.com/virtual-qemu/Armbian UTM.zip there will be a .utm file and a u-boot.bin file

download one of the virtual-emu images from our nightlies or try whatever is here https://armbian.lane-fu.com/virtual-qemu/. don't forget to extra xz file

 

find utm and right click and choose show package contents(edited)

[8:15 PM]

image.png

then you'll expand and put this u-boot.bin in this subfolder

image.png

 

open the UTM file then clone it to a new virtual machine

 

edit the new virtual machine

image.png

 

goto the drives tab

image.png

click that little trash can to delete the previous image

click import drive to load the new image that you downloaded

and make sure you set the interface to virtio

because it will default to IDE

you'll need to fiddle around with display settings possibly.. the high dpi flag etc.

 

I think I've added to default on the newer images.  make sure spice-vdagent is installed.

 

..  this is all I can help with for now.  You're on your own from here :) Please turn this into some better documentation if you can.

ideally someone needs to figure out a process around this and document it 

 

Link to post
Share on other sites

Am 19.7.2021 um 05:02 schrieb lanefu:

 

then you'll expand and put this u-boot.bin in this subfolder


Thanks @lanefu , I can mount UTM and see the Contents folder. However, the volume drive is mounted in read only mode, so that I can't copy u-boot.bin to the folder.
/Volumes/UTM/UTM.app on /private/var/folders/ns/bkcwhmm106j0_scbdvv_x29c0000gn/T/AppTranslocation/7DABB818-AE48-4EBF-9012-FF45CF3B9602 (nullfs, local, nodev, nosuid, read-only, noowners, quarantine, nobrowse, mounted by User). How can I mount the folder with read-write?

Link to post
Share on other sites

4 hours ago, why2 said:

Thanks @lanefu , I can mount UTM and see the Contents folder. However, the volume drive is mounted in read only mode, so that I can't copy u-boot.bin to the folder.
/Volumes/UTM/UTM.app on /private/var/folders/ns/bkcwhmm106j0_scbdvv_x29c0000gn/T/AppTranslocation/7DABB818-AE48-4EBF-9012-FF45CF3B9602 (nullfs, local, nodev, nosuid, read-only, noowners, quarantine, nobrowse, mounted by User). How can I mount the folder with read-write?


You need to install UTM rather than trying to run it from the disk image... UTM is a hypervisor.

Link to post
Share on other sites

Thanks, I can copy files to the UTM folder now. But I have another issue now. After setting the UTM and importing the image file (.img from the .img.xz file), I see an error "Error trying to start shared directory: The file couldn’t be opened because it isn’t in the correct format.". I set the interface to virtIO. Do I need to add a new second drive?

You wrote "make sure spice-vdagent is installed". However, `brwe install spice-vdagent`doesn't find the app or library.

screenshot_utm_error.png

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

2 2