Skip to main content

2 posts tagged with "virtualization"

View All Tags

Installing Omakub on a Proxmox Virtual Machine

· 5 min read
Adekabang
Tukang Ngoprek

I recently found myself in a common homelab dilemma: I needed a dedicated machine for a jumphost and remote development environment, but all my spare hardware was already tied up with my Proxmox server running other services. So, I decided to leverage my existing Proxmox setup and install Omakub inside a virtual machine.

Omakub, based on Ubuntu, provides a clean and efficient workspace, perfect for keeping my main PC clutter-free while still having a powerful Linux environment at my fingertips. This guide will walk you through setting up a fresh Ubuntu 24.04 VM in Proxmox and then installing Omakub.

VM Specification

For this setup, I allocated the following resources to my Proxmox VM:

  • VCPU: 8
  • RAM: 16 GB
  • Storage: 512 GB SSD

Step by Step: Ubuntu 24.04 Installation (Proxmox VM)

  1. Download Ubuntu 24.04 ISO: First, grab the official Ubuntu 24.04 Desktop ISO from the Ubuntu website. https://releases.ubuntu.com/24.04/

  2. Create a New VM in Proxmox: Follow the standard Proxmox procedure to create a new virtual machine.

    • Mount the downloaded Ubuntu ISO as a CD/DVD drive.
    • Configure the VM with the specifications mentioned above (8 VCPU, 16 GB RAM, 512 GB SSD).
    • Ensure you select "Qemu Agent" in the VM options for better integration.
  3. Install Ubuntu 24.04: Boot the VM and proceed with a fresh installation of Ubuntu 24.04 Desktop. Follow the on-screen prompts to set up your user, timezone, etc.

Post-Installation Setup

Once Ubuntu is installed and you've rebooted into your fresh desktop, perform these crucial steps before installing Omakub:

  1. Update all repositories:

    sudo apt update && sudo apt upgrade -y

    If a reboot is requested after the update, go ahead and reboot your VM.

  2. Install essential tools:

    sudo apt install -y vim qemu-guest-agent openssh-server
  3. Enable and start services:

    sudo systemctl enable --now qemu-guest-agent
    sudo systemctl enable --now ssh

Enable Remote Desktop

After ensuring your system is updated and services are running, you can enable Remote Desktop for easier access.

  1. Open Settings > System > Remote Desktop.
  2. Toggle Remote Desktop to ON.
  3. For Remote Login, you can choose to set a specific port (the default RDP port is 3389).
  4. Set your desired username and password for remote access.

Now, you can test connecting to your Ubuntu VM using an RDP client. I use Microsoft Remote Desktop on my Mac.

Omakub Installation

Once you have successfully connected to your Ubuntu VM via RDP, you can proceed with the Omakub installation using their convenient one-line script.

Open a terminal in your Ubuntu VM and run:

wget -qO- https://omakub.org/install | bash

Follow the on-screen prompts to select your preferred options. The installation will take some time and will eventually request a reboot.

Terminal Landing Page

Post-Omakub Installation & Troubleshooting

After Omakub is installed and your VM has rebooted, try to connect again via RDP.

  • Xorg Session: Omakub uses Xorg. If you experience lagging or a black screen upon login, ensure you select "Ubuntu on Xorg" after entering your username and before typing your password. Look for a small gear icon (or similar) in the bottom right corner of the login screen to choose the session type.

  • RDP Black Screen Troubleshooting (macOS Microsoft Remote Desktop): If you encounter a black screen specifically when using Microsoft Remote Desktop on macOS, you might need to adjust the RDP connection file:

    1. Right-click on your existing connection in Microsoft Remote Desktop.
    2. Select "Export" to save the connection settings as an .rdp file.
    3. Open the saved .rdp file with a text editor.
    4. Locate the line:
      use redirection server name:i:0
    5. Change it to:
      use redirection server name:i:1
    6. Save the modified file.
    7. Import the edited file as a new connection in Microsoft Remote Desktop.

    For more details, you can refer to this Reddit thread: https://www.reddit.com/r/Ubuntu/comments/1csoi05/2404_cannot_connect_via_rdp/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Troubleshooting Keyboard Shortcuts (Super Key Conflicts)

A common issue when using Remote Desktop from macOS to a Linux VM (especially with Omakub) is that macOS's system-level shortcuts can conflict with the VM's shortcuts, particularly those involving the Super key (Cmd key on Mac). For example, Super+Space often triggers Spotlight on macOS instead of Omakub's application launcher.

Shortcut Settings

To resolve this, you can adjust the hotkeys within Omakub to avoid conflicts:

  • Ulauncher ("Type app to launch"):

    • Original: Super + Space
    • New: Shift + Super + Space
    • You can find and modify this shortcut within Omakub's settings, often under "Keyboard" or "Custom Shortcuts," specifically looking for Ulauncher.
  • "See all apps" (System):

    • Original: Super + A
    • New: Shift + Super + A
  • "Close app" (Windows):

    • Original: Super + W
    • New: Shift + Super + W

By changing these keybindings in Omakub, you allow macOS to retain its system-level shortcuts while still having access to Omakub's features with non-conflicting combinations.

Conclusion

You've now successfully installed Omakub on an Ubuntu 24.04 virtual machine within Proxmox! This setup provides a powerful and isolated environment for your jumphost and remote development needs, all while leveraging your existing homelab infrastructure. Enjoy your clean main PC and your new Omakub workspace!

Omakub Theme

References

Qemu and Virt-manager in macOS (Intel-based)

· 4 min read
Adekabang
Tukang Ngoprek

So, I found this old iMac (Retina 5K, 27-inch, 2017) lying around with pretty decent specs. I'm thinking of turning it into my dedicated x86 playground since my main machine is an M1 MacBook. First thing's first: getting Qemu and Virt-manager up and running for some virtual machine action. Yeah, I know there are other VM solutions like VMware or VirtualBox, but I want to stay familiar with what's common in enterprise environments (even if nobody's running macOS in production, haha!).

Specification

iMac (Retina 5K, 27-inch, 2017)

  • Processor: 4.2 GHz Quad-Core Intel Core i7
  • Memory: 16 GB 2400 MHz DDR4
  • OS Version: Ventura 13.7.4 (22H420)

Step by Step: Qemu

  1. First, we need Homebrew to install everything.

    Get it here: https://brew.sh/

    /bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
  2. Now, let's install Qemu itself.

    Check it out here: https://formulae.brew.sh/formula/qemu

    brew install qemu
  3. Verify the installation by checking the Qemu version.

    qemu-system-x86_64 --version

    Check qemu version

  4. Let's get Ubuntu running with Qemu.

    1. Before we dive in, grab the Ubuntu ISO. I'm going with the desktop version from here: https://releases.ubuntu.com/24.04/. I'll use the desktop version (https://releases.ubuntu.com/24.04/ubuntu-24.04.2-desktop-amd64.iso).

    2. Create a disk image using qemu-img. I'm making a 20GB image in the qcow2 format.

      qemu-img create -f qcow2 ubuntu-24.04.2-desktop-amd64.qcow2 20G
    3. Fire up the VM, booting from the ISO we just downloaded (mounted as a CD drive) and attaching the virtual disk we created.

      qemu-system-x86_64 \\
      -machine type=q35,accel=hvf \\
      -smp 2 \\
      -hda ubuntu-24.04.2-desktop-amd64.qcow2 \\
      -cdrom ./ubuntu-24.04.2-desktop-amd64.iso \\
      -m 4G \\
      -vga virtio \\
      -usb \\
      -device usb-tablet \\
      -display default,show-cursor=on

      Here's a breakdown of what those flags actually mean:

      • qemu-system-x86_64: Tells QEMU we want to emulate a 64-bit Intel/AMD system.
      • machine type=q35,accel=hvf
        • type=q35: Sets the machine chipset to Q35, emulating a modern PC with PCI Express.
        • accel=hvf: Uses the Hypervisor Framework (HVF) for hardware acceleration on macOS. This makes things much faster!
      • smp 2: Gives the VM 2 CPU cores.
      • hda ubuntu-24.04.2-desktop-amd64.qcow2: Specifies the QCOW2 disk image as the primary hard drive.
      • cdrom ./ubuntu-24.04.2-desktop-amd64.iso: Mounts the ISO as a virtual CD-ROM for booting/installing.
      • m 4G: Allocates 4GB of RAM to the VM.
      • vga virtio: Uses a Virtio-based video card for better performance.
      • usb: Enables USB support.
      • device usb-tablet: Adds a virtual USB tablet for smoother mouse input.
      • display default,show-cursor=on: Makes sure the mouse cursor is visible.
    4. The VM should boot up from the ISO. Go ahead and install the OS to the virtual disk we created earlier.

    5. Once the installation is done, you can boot the VM without the ISO.

      qemu-system-x86_64 \\
      -machine type=q35,accel=hvf \\
      -smp 2 \\
      -hda ubuntu-24.04.2-desktop-amd64.qcow2 \\
      -m 4G \\
      -vga virtio \\
      -usb \\
      -device usb-tablet \\
      -display default,show-cursor=on

      Ubuntu Desktop VM in qemu

    6. To shut down the VM, do it cleanly from within the OS, or, if you're feeling lazy, just hit Ctrl+C in the terminal (but I wouldn't recommend it!).

Step by Step: Libvirt and Virt-manager

  1. Install libvirt.

    libvirt is a toolkit for managing virtualization platforms like Qemu, KVM, Xen, etc.

    Check it out here: https://formulae.brew.sh/formula/libvirt

    brew install libvirt
  2. Start the libvirt service.

    brew services start libvirt
  3. Install virt-manager. To make managing VMs easier, we'll use virt-manager as a GUI.

    Check it out here: https://formulae.brew.sh/formula/virt-manager

    brew install virt-manager
  4. Start a virt-manager session.

    virt-manager -c "qemu:///session" --no-fork
  5. Once the window pops up, you can install Ubuntu VMs and mess around.

    virt-manager window

Conclusion

So there you have it! Qemu, libvirt, and virt-manager all set up on macOS. It wasn't too bad, right? Now you can spin up VMs to your heart's content. This setup is pretty handy for testing different operating systems, playing around with software, or just generally tinkering without messing up your main system. Plus, getting familiar with these tools can be a real boost if you ever find yourself working with virtualization in a more "serious" environment. Happy virtualizing!

Reference

https://www.arthurkoziel.com/qemu-ubuntu-20-04/

https://www.arthurkoziel.com/running-virt-manager-and-libvirt-on-macos/