Installing EasyOS in a QEMU VM
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.
-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 ) 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!