GTX28
Contributor
Contributor

How to install Ubuntu on Fusion Tech preview for M1 June 2022 #Easybutton..

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 😄

I broke the process into 7 steps:
 
  1. Prep Items & Downloads
  2. VM Build
  3. Prevent Kernel Updates
  4. Install Desktop Environment
  5. Install Open VM Tools
  6. Disable Wayland
  7. Upgrade to 5.14 Kernel

Prep Items & Downloads:
 
Download Tech Preview and Install on your MAC (my ver @ publish time = Professional Version e.x.p (19431034))
 
#I found it difficult to find a version of Ubuntu that would boot as I have a preference for the desktop ver so I've included a link to the file I used.
 
ISO =ubuntu-20.04.4-live-server-arm64.iso
 

VM Build:
 
- Create a new vm select your 20.04 ISO-- select customize settings and enter the hostname you desire for your vm -- select save
- Modify system characteristics cpu/ram/disk etc -- I gave mine 4vCPU/8GB ram/68Gb NVMe disk
- Disable the network
 
#Boot and install from ISO (it will choke a few times trying to reach out to the internet, allow it to timeout and continue etc.)
#I accepted all defaults, and entered a username, hostname and pw etc. then rebooted

Prevent Kernel Updates:
 
#boot to login prompt (It may choke trying to reach the internet let it time out and continue booting)
#login with the user you created
#after login if you run hostnamectl you will see the kernel "Linux 5.4.0-100-generic"

 

sudo dpkg-reconfigure unattended-upgrades 

 

#this will open another screen select NO and it will return you to your command prompt

 

sudo apt-mark hold linux-image-generic linux-headers-generic 

 

#Hopefully it will not update the kernel again-- if anyone has additional input on anything I missed feel free to speak up
 
- Enable network for your VM

 

ip a

 

#verify your network came up as per the config you created during the OS install and you got an ip etc..

 

sudo apt update && sudo apt upgrade
sudo reboot

 

#your kernel ver should not have changed, after reboot and the system boots successfully etc.
#you can run hostnamectl again after reboot to verify you're still on the kernel ver you saw earlier.
 

 
Install Desktop Environment:

 

sudo apt install tasksel
sudo tasksel install ubuntu-desktop

 

#another option is to run the following command instead -- sudo tasksel
#this would allow you to choose a desktop other than the standard ubuntu-desktop
# select the desktop environment you want to run - I chose Ubuntu Desktop this installs the normal Ubuntu Gnome Desktop that ships with the desktop distro - Same as the "sudo tasksel ubuntu-desktop command above etc.

 

sudo reboot

 

#After reboot the box should boot into the desktop environment you've chosen. I did not get an error during the install but I've heard that some people have had issues. If it fails try to re-run the install, it should pick up where it left off.
 

Install Open VM Tools:

 

sudo apt install -y open-vm-tools-desktop
sudo reboot now

 

#if you enabled sharing the clipboard you should be able to cut and paste commands into your VM now..
 

Disable Wayland:

 

sudo nano /etc/gdm3/custom.conf

 

#uncomment the line that says "WaylandEnable=false" -- save the file

 

sudo systemctl restart gdm3

 

 

Upgrade to 5.14 kernel:
 
#login to your system again
#open the terminal

 

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

 

#I pulled these files from the following page: https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.14/
#Had to do some guessing to get this just right, feel free to chime in if I missed anything here..

 

sudo dpkg -i *.deb

 

 

hostnamectl

 

#Check your running Kernel ver

 

reboot
hostnamectl

 

#you should see your new 5.14 kernel running after the reboot

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!

Shalom,

David

 

25 Replies
mhawkshaw
Contributor
Contributor

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

0 Kudos
pittma
Contributor
Contributor

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?

0 Kudos
pittma
Contributor
Contributor

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...

0 Kudos
GTX28
Contributor
Contributor

@pittma You can't resize at all?  What is your current res? (For ref I run mine in full screen @ 1920x1080 with no problems)

Also can you post the result of running "hostnamectl" in cli to the thread?

0 Kudos
Mikero
Community Manager
Community Manager

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.

https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal/tree/drivers/video/fbdev/co...

-
Michael Roy - PM/PMM: Fusion & Workstation
0 Kudos
ashe1
Contributor
Contributor

Thank you for this! Saved me a lot of time

0 Kudos
GTX28
Contributor
Contributor

@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.

0 Kudos
petermj
Contributor
Contributor

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...

 

Screen Shot 2022-08-11 at 8.08.42 PM.png

 

0 Kudos
Technogeezer
Champion
Champion

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. 

0 Kudos
petermj
Contributor
Contributor

Thank you very much. I will try and follow your instructions hopefully this afternoon. I will post the results here.

UPDATE:

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.

0 Kudos
Ziemann1
Contributor
Contributor

Thanks for sharing such a helpful instruction.

<Link removed by Moderator>

0 Kudos
petermj
Contributor
Contributor

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.

Screen Shot 2022-08-13 at 11.20.40 AM.png

 

 

 

 

0 Kudos
Technogeezer
Champion
Champion

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:

  • Shut down the VM
  • Take a snapshot (important if something doesn’t work so you don’t lose what you’ve done)
  • Power on the VM
  • Remove the 5.19 kernel (I think the “mainline” utility will do this for you) and restart the VM
  • Run the documented procedure in the unofficial Tips and Techniques guide to upgrade to 22.04, remembering not to reboot after the upgrade is done.
  • At that point you install the 5.19 kernel. 
0 Kudos
petermj
Contributor
Contributor

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?

Thanks again.

 

0 Kudos
Technogeezer
Champion
Champion

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. 

0 Kudos
Technogeezer
Champion
Champion

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 

GRUB_TIMEOUT_STYLE=hidden

Change the line that says 

GRUB_TIMEOUT=0

to 

GRUB_TIMEOUT=10

to give you time to respond to the grub boot menu.

Save your changes.

While still sudo'd to root, execute:

update-grub

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)

apt update
apt dist-upgrade
do-release-upgrade

(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...

 

 

 

0 Kudos
petermj
Contributor
Contributor

No problem, I can wait. Thanks for your help.

0 Kudos
petermj
Contributor
Contributor

I just saw your last post with suggestions, OK, I will try it and let you know.

Thanks again.

0 Kudos
petermj
Contributor
Contributor

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. 

Thank you.

Screen Shot 2022-08-13 at 5.01.37 PM.png

 

0 Kudos