Installing EasyOS in a QEMU VM

Moderator: BarryK

Post Reply
ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

I was talking to someone earlier today about EasyOS and they mentioned that they had a hard time getting it to work in a VM. So I downloaded it, played with it a bit, and managed to get it running. It did give me a bit of trouble, but after a couple of tries I had it working pretty good, so I'm documenting what I did here in the hopes that it will help someone.

Note that this should get EasyOS running on an existing installation of Linux when using a kernel and hardware combination that supports KVM. Most 64-bit systems ship with hardware virtualization, which allows the use of KVM, but on many systems (especially older ones) may require that you enable the feature in your BIOS settings. As for the host OS, pretty much any major 64-bit distro should work - I personally am running Ubuntu. For Windows and macOS, you may have to customize these instructions in various ways, but I don't run Windows or macOS so I may not be much of a help there.

Firstly, download the EasyOS image. You should be able to find the latest one here: https://distro.ibiblio.org/easyos/amd64 ... s/dunfell/ Click on the latest year, and then the latest version of EasyOS there. (Or do what I did on accident and download the latest 2022 image instead and then have to run the updater after the fact...) Download the corresponding md5sum.txt file too.

Find wherever you downloaded the files to, and move them into their own folder. You don't have to do this, but I personally prefer to have my filesystem *not* turn into a mess so I like to at least try to keep things organized.

Open a terminal in the folder containing your EasyOS image and md5sum.txt file, and run `md5sum -c md5sum.txt` - this will use the info in the md5sum.txt file to check the EasyOS image and make sure that it downloaded properly. If all goes well, it should print an "OK" to the screen.

With that done, make a disk image for the VM. The easiest way to do this for me was to just copy the EasyOS image to a second file with a different name and then grow the file so that you have room for your stuff. `cp easy-4.5.5-amd64.img vm.img && truncate -s 8G vm.img` should do the trick. This will give you an 8 GB image with EasyOS already loaded onto it. And you'll have the original download still there so that you can start from scratch if something goes south.

Now we can just boot the VM. I personally prefer using raw QEMU for this (`sudo apt install qemu-system-x86` should install it on Ubuntu or Debian). Assuming you have QEMU installed, the command to boot the VM is `qemu-system-x86_64 -enable-kvm -m 4G -smp 2 -nic user -hda vm.img`. What this command does, in detail, is:

qemu-system-x86_64: Launches the 64-bit QEMU emulator.
-enable-kvm: Uses hardware virtualization to accelerate the VM - this is needed if you want your VM to go any faster than a snail trying to pull a freight train through quicksand. :D
-m 4G: Gives the VM 4 GB of RAM. You can almost certainly get away with less, but I have 32 GB of RAM on my laptop so 4 GB is easy.
-smp 2: Gives the VM 2 CPUs. You can probably just omit this part, but depending on what you're doing, you may find that using two or more CPUs gives you better performance.
-nic user: Provides the VM with an NIC with user-mode networking. Or, in simpler terms, gives the VM Internet access.
-hda vm.img: Uses our newly created VM image as the VMs main hard drive.

Once you have that typed in, hit Enter, and you should see the VM window appear on your screen. Press Enter to boot EasyOS. EasyOS will now go through a bunch of setup steps, and ask you a few questions. Proceed through this initial wizard, and eventually the X server will try to start.

And fail to start.

This is where things get a bit tricky - for some reason EasyOS does not like QEMU's default graphics hardware very much. Thankfully, it's pretty easy to fix. In the VM, run `xorgwizard`.

This will pop up a screen asking if you want to use "modesetting" or "vesa" for your graphics. You must select "vesa" here or the graphics will probably not work. (At least that was my experience). Select "vesa", then press Enter.

When asked about your screen's resolution, select "NOTHING" and press Enter - this will let Xorg guess the right resolution. Finally, press Enter again to test and make sure things work. Your VM window will probably suddenly become massive, and you should see some text indicating that X is working. If so, press Enter once more and you should have graphics functioning properly.

Now just run `xwin jwm` and in a few seconds you should be at a working desktop.

In all likelihood this desktop will be way too big for your screen. (It's too big even for my Full HD screen :lol:) To work around this problem, in the QEMU menu bar, click "VIew", then "Zoom to fit". Then unmaximize and maximize the QEMU window, and you should be able to see the whole (though admittedly shrunk) screen.

Assuming everything's working right, you should see the Quick Setup window now. You'll notice it has an option to change the screen resolution - change it from 1920x1080 (or whatever other default it went to) down to something smaller (1280x768 is the smallest it will give me). Then click OK. The resolution won't change right away, but it will in a bit.

Next click OK in the XKB Configuration Manager window that pops up. And then click "Exit" in the second XKB Configuration Manager window that pops up. Then click OK in the next pop-up - your screen resolution should change now.

Assuming that things work right, click "Permanent" to save the new screen resolution. The firewall popup should be the next thing to appear - click Apply.

Next you'll be asked about the clock, and whether it stores the local time or UTC time. This should *probably* be set to UTC. Change the option to UTC and accept, then click "No" in the next popup window since you probably don't need to change either the software or hardware clocks. (This is a VM after all, the software and hardware clocks should be identical, I believe. They are on my system.)

Last but not least, in the QEMU menu bar, click View -> Zoom to fit again to get rid of the display scaling and make the VM display look normal. Then unmaximize the window and click View -> Best Fit to get the QEMU window to match the VM's display size.

You should now have a finished VM! Hope this helps someone. Make sure to click "SAVE SESSION" when you shut down the VM, or else you're going to have to do a bunch of this process all over again when you boot the VM next time. Guess how I learned this. Oh, and also, absolutely do not press Alt+F4 to try to close windows within the VM - this will close the QEMU window which will force shutdown the VM.

Good luck!

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

NOTE: OK so the above setup does allow EasyOS to boot, but something's awry with it - I can't launch any containerized apps. Non-containerized ones launch just fine. I just flashed EasyOS to an SD card and booted it on a Chromebook with MrChromebox firmware installed, and containerized apps work just fine there, so something in the above instructions isn't quite correct. If anyone knows what exactly I'm missing here (maybe containerized apps don't work with the vesa graphics?), that would be great.

Caramel
Posts: 323
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 53 times

Re: Installing EasyOS in a QEMU VM

Post by Caramel »

Some containers like buster or dunfell are displayed by the xephyr server (https://linux.die.net/man/1/xephyr) that is limited
But others lkie Terminal or chromium use xorg

I don't know any more

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

Yeah, I'm not sure what's going on with the containers in a VM - if I click on the containerized Firefox or terminal, the click registers but it appears to do nothing. I also tried figuring out the command line used to launch each one (I think the firefox one was "ec-chroot-firefox"), and running that also did nothing - no errors on the terminal, no window on the screen.

My current suspicion is that the vesa video mode is somehow messing up those kinds of containers, however I've not been able to verify this since I can't get a VM to use any video mode other than vesa successfully, and I can't seem to get my Chromebook to switch to vesa video either :P It could also be that I'm missing a CPU feature in the VM - I'm just using the default qemu64 CPU I believe, so maybe I'll try host passthrough or something similar and see if that works.

Also, clicking on the "dunfell" container actually does do something - the VM screen turns solid black for a moment, then the desktop reappears. Which looks like the container launches and then promptly crashes, though again I'm not sure.

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

Adding "-cpu host" to the QEMU commandline had no effect that I could see.

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

Alright, I have indeed verified that it is the vesa graphics that mess up the containers - when I boot my Chromebook with vesa graphics, the containers fail to launch again.

So, now the question is how to get non-vesa graphics in a QEMU VM.

Clarity
Posts: 3279
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1351 times
Been thanked: 439 times

Re: Installing EasyOS in a QEMU VM

Post by Clarity »

IN review of your QEMU stanza and assuming your host is running QEMU v7+, I offer you this for the video issues you see. ONE of the following should/may get your EASY VM to yield the video properties you seek. (I admit, I have not tried EASY as its IMG is not a normal bookable image file; rather it is a shipping container)

  • -vga cirrus

  • -vga std

  • -vga virtio

This stanza in my tests is the only one that gets to a usable console, but cannot get the desktop working after console arrival:

Code: Select all

qemu-system-x86_64 -enable-kvm -vga cirrus -m 2G -smp 2 -device AC97 -name "EASY via QEMU" -hda easy-4.5.5-amd64.img

Loaded EASY onto my Ventoy USB stick and selected easy... from its Menu took me here:qemu-system-x86_64 -enable-kvm -vga cirrus -m 2G -smp 2 -device AC97 -name "EASY via Ventoy" -hda /dev/sdg

EASY in a VM.jpg
EASY in a VM.jpg (94.15 KiB) Viewed 1024 times

But, again, unable to get to desktop from booting the IMG file. I have not tried nor will I create an installation disk for use with this distro.

I DO recognize the expectation that EASY is intended for running from a system drive, per se. Thus my tests would probably not work by directly booting its IMG file. I would expect, though, that it should boot IFF "installed" to some media.

Enjoy and repost your successful stanza after testing, please

Last edited by Clarity on Fri Feb 17, 2023 11:35 pm, edited 1 time in total.
ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

Yeah, I tried Cirrus VGA but the driver for it in Easy seems to be ignored for some reason. I get to a working console, run xorgwizard, try to use the modesetting driver, and it fails with "(EE) no screens found(EE)". Interestingly, with Cirrus, even the VESA driver fails. When I use -vga std, I have to select the VESA driver and then I get a working desktop but with the containerized apps unable to launch.

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

The working stanza, as requested:

Code: Select all

cp easy-4.5.5-amd64.img vm.img
truncate -s 8G vm.img
qemu-system-x86_64 -enable-kvm -vga std -m 2G -smp 2 -device AC97 -name "EASY via QEMU" -hda vm.img

Screenshot:

(Imgur link to avoid full-size and rather large image from loading inline)

Caramel
Posts: 323
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 53 times

Re: Installing EasyOS in a QEMU VM

Post by Caramel »

Just an idea, without conviction.

In the configuration file of the container, verify that the DRI that provides hardware accelerated graphics is disabled

For example for the container dunfell, the configuration file is /mnt/wkg/containers/dunfell/configuration .

Normally the line starting by EC_ACCESS_DRI= is missing but in testing i sometimes saw the line EC_ACCESS_DRI="true" without understand. If the line exists, the value must be false.

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

<removed - I failed to quote and then failed to edit the post in order to quote :P>

Last edited by ArrayBolt3 on Tue Feb 21, 2023 4:18 am, edited 1 time in total.
ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

Caramel wrote: Mon Feb 20, 2023 4:13 pm

Just an idea, without conviction.

In the configuration file of the container, verify that the DRI that provides hardware accelerated graphics is disabled

For example for the container dunfell, the configuration file is /mnt/wkg/containers/dunfell/configuration .

Normally the line starting by EC_ACCESS_DRI= is missing but in testing i sometimes saw the line EC_ACCESS_DRI="true" without understand. If the line exists, the value must be false.

That looks quite hopeful, I give that a shot when I get the time. Thanks!

ArrayBolt3
Posts: 14
Joined: Tue Aug 02, 2022 6:28 am
Been thanked: 1 time

Re: Installing EasyOS in a QEMU VM

Post by ArrayBolt3 »

WOW IT WORKED!

I just went in to each container's config file, removed the "EC_ACCESS_DRI=true" lines, saved changes, and now the containerized apps work. Firefox, sakura, dunfell, all work in QEMU now. It makes perfect sense why that works. Thank you so much!

Post Reply

Return to “Containers and VMs”