Set up a Ubuntu based workstation | Step 3: VM Guest Installation and Configuration
This article is the third tutorial of a series on how to set up a multi-purpose Ubuntu based workstation. In the previous article, we have installed and configured KVM/QEMU on the host machine. In this article, we will install and configure a VM guest as the main development environment.
OS Installation
OS installation on the VM guest is similar to that on a physical machine, and the process is mostly self-explanatory. The differences are that: 1. you need to create a virtual machine first 2. you do NOT need to create a bootable USB flash drive, just use the downloaded ISO image directly.
In this article, we use *Virtual Machine Manager* (`virt-manager`) to create an Ubuntu 24.04 LTS VM guest.
Create a new VM guest
1. Open *Virtual Machine Manager* and click on "File > New Virtual Machine" to start the VM creation wizard. 2. Select "Local install media (ISO image or CDROM)" and click "Forward" 3. Click "Browse" and select the downloaded Ubuntu 24.04 LTS ISO image (you may need to put the ISO in the default location `/var/lib/libvirt/images` in advance), then click "Forward". 4. Allocate appropriate resources for the VM (e.g. 16 CPU cores, 32 GB RAM, 128 GB disk space), and click "Forward" 5. Choose "Bridge Device" for network configuration 6. Select "Customize configuration before install" 7. In the customization window, click on "Overview" and change the firmware to "UEFI" instead of "BIOS", and click "Apply" 8. In the customization window, click on "Video Virtio" and disable "3D Acceleration", and click "Apply" 9. Click "Begin Installation" to start the OS installation process, which is the same as installing Ubuntu on a physical machine.
Install Ubuntu 24.04 LTS on the VM guest
Follow the on-screen instructions to complete the installation process. Note, since the VM is using vda storage, the disk will be named as `/dev/vda` instead of `/dev/sda` during the installation process, and you do not need LVM partitioning, just use the entire disk for installation. After the installation is complete, you can log in to the VM guest and perform basic settings.
Basic Settings
Set up SSH server
sudo apt install -y openssh-server sudo systemctl enable ssh sudo systemctl start ssh # one can check the status by # `sudo systemctl status ssh`
Configure SSH/GPG forwarding
@see: https://github.com/madpang/pd-imagine "Ticket 2" in tickets.txt
Install tmux
I personally prefer using `tmux` as the terminal multiplexer, and it is also very useful for remote development. Install `tmux` with the following command:
sudo apt install -y tmux
And here is a minimal `~/.tmux.conf` configuration file that I use: ``` # @brief: a tmux configuration for a better terminal experience # @details: copy this file to $HOME/.tmux.conf