When I got my new MAC for work I was surprised at how difficult it was to get an Ubuntu VM running and abandoned my first efforts and ended up making a QEMU vm with UTM as it was alot less friction to get it running.
The point of this post is to both document how I eventually got an Ubuntu VM working, but also to consolidate information spread across a bunch of posts into one place and make it easier for people to follow a step by step set of instructions and quickly get a VM running.
A few caveats to start with. This assumes you have Fusion Tech Preview installed, and have some idea how to use Linux cli etc. I've only been successful so far with Ubuntu 20.04. (other versions may work, but this tutorial will focus on the 20.04 LTS ver of Ubuntu) We will be starting with the Server for ARM edition of the software as it was the easiest one to find thats an ARM edition of the software and has a kernel old enough to still work. Don't worry I'll show you how to build the Desktop environment your used to, its dirt simple 2-3 commands max. I got you bro 😄
sudo dpkg-reconfigure unattended-upgrades
sudo apt-mark hold linux-image-generic linux-headers-generic
sudo apt update && sudo apt upgrade sudo reboot
sudo apt install tasksel sudo tasksel install ubuntu-desktop
sudo apt install -y open-vm-tools-desktop sudo reboot now
sudo nano /etc/gdm3/custom.conf
sudo systemctl restart gdm3
mkdir kernel_upgrade cd kernel_upgrade
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.14/amd64/linux-headers-5.14.0-051400_5.14.0-051400.202108292331_all.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.14/arm64/linux-image-unsigned-5.14.0-051400-generic_5.14.0-051400.202108292331_arm64.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.14/arm64/linux-modules-5.14.0-051400-generic_5.14.0-051400.202108292331_arm64.deb
sudo dpkg -i *.deb
Sorry about the goofy spacing in the article, this is about the best I can do with this automated markup editor... Again feel free to chime in if I missed something in the directions, or there is a better way to do something. I hope that this helps someone. Happy Tuesday!
Thanks a lot for taking the time to write these instructions! It worked for me. This step:
sudo tasksel ubuntu-desktop
didn't work for me, but entering "sudo tasksel" and selecting Ubuntu Desktop did.
Hopefully VMware will provide an update to the Fusion M1 Preview Edition in June to support newer kernels
Brilliant work, thanks so much for putting all of this together. Has anyone else struggled to get full screen resolution to work? In full screen, my resolution stays at a low 4:3 ratio. I confirmed that vmtools is working because I can copy across host to guest. Is there a step I've missed along the way?
Sorry, y'all. I hadn't done all of the reading yet. This is a known issue. This discussion covers it: https://communities.vmware.com/t5/Fusion-for-Apple-Silicon-Tech/Ubuntu-Desktop-20-04-3-LTS-resolutio...
The issue isn't that we don't support newer kernels, it's that there's a bug in Linux that hasn't been picked up by various distros yet.
I'm testing 5.17, 5.18 all day long, they work great so long as they don't have this bug.
You can verify that the fix it's not in Ubuntu kernels at all by comparing the patched fbmem.c and the one that Ubuntu is using.
@mhawkshaw -- My apologies I screwed up the command when I typed the article here. The correct command is:
sudo tasksel install ubuntu-desktop
Thank you for the feedback, I fixed the original post to reflect the correct command.
Thanks a million for creating this guide. I have followed it and was able to get the VM partially up and running.
My VM will not boot any longer after the steps to install the 5.14 Kernel. After installing the kernel with the "sudo dpkg -i *.deb" command and attempting the reboot the VM gets stuck. See screenshot below. I have a snapshot before the command so I can try again if anyone has any suggestions as to what's going on.
Please help, so close and yet so far...
Your problem is the 5.14 kernel. Between Ubuntu failing to include Linux kernel patches and VMware making changes to this version of the Tech Preview 5.14 kernels don’t work. Revert your snapshot and install the mainline 5.19 kernel. That is known to work with the 22H2 Tech Preview . Canonical hasn’t managed to break that kernel (yet).
See the newly updated unofficial Tips and Techniques document https://communities.vmware.com/t5/Fusion-22H2-Tech-Preview/Tips-and-Techniques-for-the-Apple-Silicon... for updated advice on using Ubuntu on the 22H2 Tech Preview.
There’s a section in the document on obtaining Ubuntu mainline kernels. It recommends the use of the open-source “mainline” utility. It’s a lot easier to use than to download and install kernels manually.
Thank you very much. I will try and follow your instructions hopefully this afternoon. I will post the results here.
OK, I was able to update the Kernel to 5.19.0, although I noticed that 5.19.1 was available... I used the GUI version of mainline and it was super easy.
Now I shall attempt the upgrade to 22.04.
The saga continues.
Thanks for your help.
I'm looking for a bit more help 😀.
I now have a working VM running Ubuntu 20.04.4 with the 5.19 kernel. I'm able to adjust the resolution and everything looks good. So I decided to take the next step and upgrade to 22.04.4 using the instructions gratefully provided by Technogeezer in his guide.
In step #4 I start to run into problems. See the screenshot below of all the things I tried. Basically, there seem to be unresolvable updates and I don't know how to proceed.
Please try and help me get through this last bump.
Thank you very much.
I’m assuming that you did not mark the kernel packages so that they would not update. It may be the case that the installed 5.19 mainline kernel is preventing the upgrade. If so, I would proceed as follows:
Hi, thanks for the prompt reply.
I did mark the kernel to not update, but I did it when I first created the VM. Should I have done it again after installing the 5.19 kernel?
Also, if I remove the kernel with mainline, will the VM still work? Or does removing the 5.19 kernel install some other kernel?
I think that marking the kernel so that it doesn’t update is the source of your problem. You needed to do that with the 21H1 tech preview but from my experience it isn’t needed for the 22H2 Tech Preview with Ubuntu 20.04
I have an idea how to move you forward, but give me a bit so I can give you an exact series of steps that will get you there.
Ok, here's how I suggest you proceed:
This procedure is complicated by the fact that installing a 5.19 kernel directly under 20.04 LTS does not completely succeed since there are updated libraries that the one of the 5.19 kernel headers requires.
First. let's get Ubuntu so that it shows you the grub boot menu without you having to time the "esc" key at boot.
Sudo to root, and edit /etc/default/grub.
comment out the line that says
Change the line that says
to give you time to respond to the grub boot menu.
Save your changes.
While still sudo'd to root, execute:
To finish updating grub settings.
Reboot your VM.
In the grub boot menu, select "Advanced options for Ubuntu", and boot the latest 5.4 kernel you find.
Once booted, sudo to root and use the mainline utility to remove the 5.19 kernel:
mainline --uninstall 5.19.0
Remove the existing holds you have on the kernel and associated files.
Update and upgrade Ubuntu (note that 22.04.1 is now available, so the command to upgrade has changed)
(you no longer need the -d argument to do-release-upgrade)
At the end of the upgrade, do not reboot, instead answer the question with "N". Hit a return key when the screen appears to be sitting there, and answer to cancel the screen session. That should drop you back into the shell prompt.
At this point. install the 5.19.0 or 5.19.1 mainline kernel with the mainline utility:
mainline --install 5.19.1
Reboot and you should be good to go...
OK, basically your instructions worked, but I seemed to have run out of disk space during the process. See below. My VM has a 30GB disk defined.
I tried increasing the hard disk space on the VM that works, but it seems that the guest does not see the increased amount. Would you know how to fix that so that Ubuntu sees the whole amount of space defined for the VM?
The VM rebooted to 22.04 but had lots of errors reported, I think most related to having no space left.