Category: Desktop

  • Building the VMware Workstation Modules on Ubuntu 24.04 with Secure Boot Enabled

    Hello everyone! I hope you have all been well and staying safe. Today’s blog is one that I hope you find helpful.

    So while I use KVM primarily for VM’s on my laptop and even on my servers, I still use VMware Workstation on my Laptop for quick testing. However, with the latest release (25H2 as of today), I was still running into issues where the vmmon and the vmnet modules would build, but not install properly. After looking through my logs, I found out that the reason they were not loading is because they were not signed. I use Secure Boot on my Laptop, and because of that, the kernel will not load unsigned modules into memory, thinking they are insecure. However, I have found a way to install the modules, and maintain security of the system. This blog will detail how to create a key, install the key, and sign the kernel modules after they have been compiled so that they will load properly.

    So I download and install VMware Workstation from Broadcom’s support site. It’s free now for personal use. Once you download it, I had to change the permissions so that it was executable, and then ran the installer from the terminal:

    chmod +x VMware-Workstation-Full-25H2-24995812.x86_64.bundle
    
    sudo ./VMware-Workstation-Full-25H2-24995812.x86_64.bundle

    After the installation, the kernel modules will be build, but they will not install. When you try to run a VM, it will fail saying it couldn’t load the vmmon module. When I tried to install the modules from the CLI, I was presented with the following error:

    sudo modprobe vmmon
    
    modprobe: ERROR: could not insert 'vmmon': Key was rejected by service

    After a little searching, I found this was becuase I am using Secure Boot and the kernel modules are not signed. So I had to do the following to sign the modules.

    First, I had to create a private key and a certificate to sign the modules. I had to create a Machine Owner Key (MOK). This also has to be added to the MOK database in Secure Boot to prove that the modules have been built and trusted by the system. I did the following to create the keys:

    openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=My Kernel Module Signing/"

    Now I had two files in my home directory, MOK.priv, the Private Key, and MOK.der, the DER formatted Certificate.

    I now had to use the mokutil command to install the keys into the database:

    sudo mokutil --import MOK.der

    I had to create a password to install the certificate. Remember this password because when you reboot the machine, it will ask for this password to install the certificate. Do that and then log back in to the machine.

    Once logged in, open a terminal and find the path for the modules:

    modinfo -n vmmon
    modinfo -n vmnet

    They will be in the /lib/modules/$(uname -r)/misc directory, however we will be using this as a variable in the next command, which is what we will use to sign the modules:

    sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 MOK.priv MOK.der $(modinfo -n vmmon)
    
    sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 MOK.priv MOK.der $(modinfo -n vmnet)

    You can then use the modprobe command to install the modules, but I normally just reboot my laptop to have everything start correctly, and then I can open VMware Workstation normally.

    I hope this helps you, and this process can be used to sign any module that you may need to.

  • Quake 4 on Ubuntu 24.04 that Actually works!

    Hello everyone. I hope you are doing well and staying safe. Welcome to another blog entry on gaming on Linux, primarily Ubuntu 24.04.2.

    I am a huge id Software fan. Have been since Wolfenstein 3-D in the early 90’s. However, one of my favorites is Quake 4. The story and everything about it is awesome. It’s a direct sequel to Quake 2, which is probably by second favorite Quake game in the series.

    So, I wanted to install my copy that I have on DVD that has worked really well in the past, only to my chagrin did I find out that this is was going to be a journey. So if you are having issues setting up Quake 4 on your Ubuntu 24.04 machine, and getting it to run at all with sound included, read on and please like, share and comment so I know that this guide helped you as well.

    So, I’ve installed Quake 4 on Linux many times. In fact, it’s one of the first things I install on Linux once everything is all setup. It’s like a reward for a job well done. So here is what I had to do to get it to work.

    First thing I did was pull out the old DVD from my desk drawer, and put it in my DVD drive. On my Intel NUC, which is now my primary desktop machine now, I just plugged in a USB one and Ubuntu mounted the DVD with no issues. It was mounted in /media/wililupy/QUAKE4/ directory.

    I then created the directory I wanted to install Quake 4 to, which is /usr/local/games/quake4. I have to copy all the pk4 files to this directory, so I opened a terminal and ran the following command:

    sudo mkdir -p /usr/local/games/quake4/q4base/
    sudo cp /media/wililupy/QUAKE4/Setup/Data/q4base/*.pk4 /usr/local/games/quake4/q4base

    This took about 10 minutes to copy all the pk4 files. I then needed to download the quake4 linux binaries. Luckily, I had a copy I previously downloaded because the id software FTP site is no longer online. For those of you in the same boat, here is a link to it off of this web server:

    NOTE: Make sure you “right click” and Click Save link as: otherwise it will load this script in the web browser

    quake4-linux-1.4.2.x86.run

    Once you have downloaded the binaries, you need to enable it to be executable:

    chmod a+x quake4-linux-1.4.2.x86.run

    Now, here is where I was stuck for a while, but I finally figured out how to get this binary to work correctly.

    I had to install the following packages to make sure everything would work, including adding a PPA for libxp6, which isn’t available for 24.04:

    sudo add-apt-repository ppa:zeehio/libxp
    sudo apt update
    sudo apt install libxp6 \
         libssl-dev \
         libasound-plugins:i386 \
         pipewire-alsa:i386

    I could then install the quake4 binaries by running the following command:

    sudo sh ./quake4-linux-1.4.2.x86.run

    I accepted all the licenses, and when it asked where I wanted to install Quake 4, I used the default path, which is where I uploaded the pk4 files:

    /usr/local/games/quake4

    I also installed Punkbuster, but I don’t think it is even still around, please comment if that is true or not.

    Once it finished installing, I started Quake 4, and it failed to start. It appears that the included libraries are not compatible with Ubuntu 24.04.2, so I created a folder in the quake4 directory called temp and moved the lib files there:

    cd /usr/local/games/quake4
    sudo mkdir -p temp/
    sudo mv lib* temp/

    I then created symbolic links to the ones installed on my system to the quake4 directory:

    sudo ln -s /usr/lib/i386-linux-gnu/libSDL-1.2.so.0 libSDL-1.2.id.so.0
    sudo ln -s /usr/lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1
    sudo ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6 libstdc++.so.6

    I then ran quake4-smp to run and the game fired up with full audio. The only issue I had now was the game was in Spanish. To fix this I updated the Quake 4 configuration file in my home directory:

    vi ~/.quake4/q4base/Quake4Config.cfg

    I searched for sys_lang and changed it from "spanish" to "english" and saved the file and then restart Quake 4 and everything started and worked normally. I can now play my favorite Quake title on my favorite OS.

    Now, these next few things are optional, but I like them because it makes playing the game a little more seamless. I like to have an icon in the Application Launcher for Gnome. Quake 4 comes with a bitmap icon, but the background is magenta and an eye sore. So I use GIMP to make the background transparent and remove the magenta color and then save it as a PNG file. Then I put this icon png file in /usr/share/icons and call it “quake4.png”

    I have a link to the png I use here. You can download it and save it to /usr/share/icons and then it will be the icon when you create the desktop link file.

    Next, I create an .desktop file called quake4.desktop and put this file in /usr/share/applications. Below are the contents of the file:

    [Desktop Entry]
    Name=Quake 4
    Comment=First-person shooter - sequel to Quake 2
    Icon=quake4
    Exec=quake4-smp
    Terminal=false
    Type=Application
    Categories=Game;ActionGame;

    Save the file and give ownership to root and make sure it has 644 permissions:

    sudo chown root:root quake4.desktop
    sudo chmod 644 quake4.desktop

    I hope this helps you and everyone else that is running into this and wanting to play a game.

    Happy Fragging!

2Shares