Tag Archives: Linux

Linux Desktop Virtual Machines

Ubuntu Desktop - Linux Desktop Virtual Machine
Ubuntu Desktop

Several Ubuntu Linux desktop VMs support general-purpose desktop applications and our DXalarm Clocks. The following steps create the base VMs for these applications.

VM Install

The VMs are created as follows:

  • Image – Ubuntu Desktop download from here.
  • CPUs – 4
  • Memory – 4096 MB, Balloning = off
  • Network – LS Services, VLAN 10
  • Disk – 32 GB, SSD, Discard = on, Cache = Write through
  • QEMU Agent – Installed via apt install quemu-guest-agent && systemctl start qemu-guest-agent

The CPU and Memory parameters are chosen to be on the high side for most applications. This enables a quick installation and setup of the resulting VM. These parameters can be adjusted lower to match the actual workload for each provisioned VM.

Run the Ubuntu installer on the initial boot as follows:

  • US English
  • Normal Installation, Download Updates while installing
  • Erase Disk and Install Ubuntu
  • Timezone = New York, Automatic Timezone, AM/PM Time Format
  • Set computer name and login credentials

I also installed SSH access for all logins. The procedure for doing this can be found here.

Next was a few post-setup configuration steps:

  • Dark Style
  • Set Desktop Wallpaper
  • Setup Remote Desktop and VNC Sharing

Finally, we installed the following via the Ubuntu Software apps:

  • Extension Manager
  • Allow Locked Remote Desktop via Extension Manager (by name search)

E-mail Forwarding

Outbound e-mail is set up via nullmailer using the procedure outlined here.

# Run this as root
sudo bash

# Install nullmailer and mail apps
apt-get install nullmailer mailutils

# Move to the nullmailer directory
cd /etc/nullmailer

# Create configuration files
vi defaultdomain
...
anita-fred.net
:wq

vi adminaddr
...
<my-email-address>
:wq

# This file sets up TLS access to smtp2go
sudo vi /etc/remotes
...
mail.smtp2go.com smtp --port=587 --starttls --user=<my smtp2go login ID> --pass=<my stmp2go password>
:wq

# The next three steps are important!
chmod 644 defaultdomain adminaddr
chmod 600 remotes
chown mail:mail defaultdomain adminaddr remotes

# Check status of nullmailer
service nullmailer status

# Send a test e-mail
mailx -s "Test e-mail via nullmailer MTA" <email address>
...

Sound Through Remote Desktop Client

The xRDP extensions enable sound from our Ubuntu VMs via Remote Desktop. The procedure to install the necessary extensions in Ubuntu VMs can be found here.

The steps are as follows:

# Must run these commands as normal user, not root
su - fkemmerer

# Download script, unzip it, & make it exeutable
wget https://www.c-nergy.be/downloads/xRDP/xrdp-installer-1.4.3.zip
unzip xrdp-installer-1.4.3.zip
chmod +x xrdp-installer-1.4.3.sh

# Must use -s to install sound drivers
./xrdp-installer-1.4.3.sh -s

# Shutdown machine, then reboot
sudo shutdown

Applications

Installed the following applications

  • Chrome & associated apps
  • VLC Player

Install the Python IDE interface as follows:

sudo apt install idle

Template Conversion and Use

The fully set up VM has been converted to a template. The template can you used to create Ubuntu Desktop VMs using the following steps:

  • Clone (unlinked clone is preferred) the template to a VM
  • Edit /etc/hosts and /etc/hostname to set the system name for the new VM
  • Add the new VM to the Backup and HA configurations

 

Linux Packages and Tools

We use a variety of Linux Packages and Tools in our Homelab. This page explains how we set up and manage them.

Git Repo

We are maintaining a private git repository to store Docker Compose files, Ansible playbooks, and shell configuration scripts for setting up tools and utilities on our machines, VMs, and LXC. The following video explains how to set up a git client on the Ubuntu server to access and update our repo.


How to Install and Configure Git

Some notes on the installation process above:

  • You must use your GitHub access token at any password prompts
  • Need to install ansible via sudo apt install ansible

Network and DNS Tools

Most of the systems here run Linux distributions in Debian or Ubuntu. We add a standard set of tools to our Linux machines to create our working environment. These packages are installed with the following commands:

# Update repository information
apt update

# Network utilities including nslookup & ifconfig
apt install dnsutils
apt install net-tools

# The tmux terminal multiplexor
apt install tmux

tmux on macOS

MacOS does not support repository access outside of the box. To enable this, we first need to install Brew, and then we can install tmux. The commands to do this are (from the macOS terminal in user mode) –

# install brew on macOS (this takes awhile...)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Update PATH to include brew
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/<USER>/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"

# Now install tmux
brew install tmux