Ubuntu 21.04 Installation Guide

Discussion in 'Linux Virtual Machine' started by Zshrc, Sep 23, 2021.

  1. Zshrc

    Zshrc Member

    Messages:
    21
    Hey all, some people (as am I) are experiencing issues running Ubuntu 21.04 on Parallels 17.0.1. Here's a quick write-up/guide to get around this. It involves using the v5.14 Mainline kernel instead of the default Ubuntu kernel. Mind you it does come with some risks and I AM IN NO WAY RESPONSIBLE FOR IF ANYTHING GOES AWOL. I've only tested this on ARM. Intel people, let me know how this works out for you.

    1) Install Ubuntu 21.04
    Duh, just grab the Ubuntu Server ISO. If you're on x86_64, then you can use Ubuntu Desktop and can ignore Step 10.

    2) Reboot into Ubuntu 21.04 and update the system
    The reboot can take as long as 10 minutes. 0_o Just be patient, you'll only need to do this once.
    Then execute:
    `sudo apt update && sudo apt upgrade`

    3 - x86_64) Download v5.14 Mainline kernels
    This ONLY applies to Intel Macs, M1 peeps keep scrolling.
    Download the v5.14 Mainline kernel from here. Unfortunately, you can't use the latest (as of writing) v5.14.7 release because it uses Ubuntu 21.10's libc instead of 21.04. If this bothers you, you can follow the M1 part of the guide. After this step, skip to Step 8.

    3 - ARM) Download Linux Kernel Build Dependencies
    The reason why we need to build Linux is that FOR SOME REASON, the linux-headers tools included in the Mainline kernels are compiled for x86_64, even the ARM one... So... ¯\_(ツ)_/¯

    The Linux kernel needs A LOT to build, here's everything you'll need:
    `sudo apt install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev libssl-dev flex bison zstd`

    You'll be prompted to configure exec-tools, just NO.
    Then you'll be asked to restart services. DON'T. It times out....

    4 - ARM) Clone Linux Kernel tree and grab 5.14 branch
    Linux is a big project, the clone might take a couple of minutes depending on the connection.
    `mkdir build && cd build`
    `git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git`
    `cd linux`
    `git checkout -b parallels v5.14`

    5 - ARM) Configure Linux
    There are a few options you need to change for Linux to compile. Since this is a newer kernel than Ubuntu's .config, some fields will require manual input.
    `make clean`
    `cp /boot/config-$(uname -r)`
    `scripts/config --disable DEBUG_INFO`
    `sed -i 's:$ CONFIG_ARCH_APPLE is not set:CONFIG_ARCH_APPLE=y:g' .config
    `scripts/config --disable SYSTEM_TRUSTED_KEYS`
    `scripts/config --disable SYSTEM_REVOCATION_KEYS`

    6 - ARM) Build Linux
    `time make -j $(getconf _NPROCESSORS_ONLN) bindeb-pkg LOCALVERSION=-parallels`

    You'll be prompted at 'SERIAL_SAMSUNG', just type N
    Then 'SYSTEM_TRUST_KEYS' and 'SYSTEM_REVOCATION_KEYS' will prompt for text, just click enter.
    Now walk away, this will take some time (Took about 40 minutes on my M1 MacBook Pro). Go watch an episode of 'What If...' or something.

    7 - ARM) Install Linux
    `sudo dpkg -i ../linux-headers-*.deb ../linux-image-*.deb`

    8) Configure GRUB
    I like having the GRUB boot menu show just in case this kernel decides to nuke my system.
    `sudo vim /etc/default/grub`
    - Change GRUB_TIMEOUT_STYLE to menu
    - Change GRUB_TIMEOUT to 10
    `sudo update-grub`

    9) Install Ubuntu Desktop
    If you used the Ubuntu Desktop image, you can skip this. Otherwise:
    `sudo apt install tasksel`
    `sudo tasksel install ubuntu-desktop`
    `sudo reboot`

    10) Install Parallels Tools
    Your system should now reboot MUCH faster than the first time, but it's not over yet.
    If you're using an x86_64 system, you'll need to apply a patch to Parallels Tools found here.
    Otherwise/once that's done, install the tools normally.

    11) Congratulations
    Congrats! After a reboot, Ubuntu should be slightly better than before. I have only tested this with Ubuntu 21.04, but I assume the steps are the same/similar for Ubuntu 20.04 and other Ubuntu flavors. I found some weird screen tearing anomaly happen with Xorg. Not sure why, but Wayland isn't an issue so I just used that. Enjoy!

    Sources
    https://askubuntu.com/questions/718...-install-custom-mainline-kernel/718662#718662 (Kernel compile guide)
    https://forum.parallels.com/threads...l-5-14-2-parallels-tools-17-0-0-51461.354739/ (Parallels x86_64 patch)
    https://forum.parallels.com/threads/issue-with-parallels-ubuntu-vm-and-the-cd-rom.354750/ (Original CD-ROM investigation)
    https://wiki.ubuntu.com/KernelTeam/GitKernelBuild (Ubuntu Mainline Kernel build guide)
     
    JaniP likes this.

Share This Page