Virtual machines enable developers to emulate production environments and toolchains on their desktops for coding without affecting the host setup. In this advanced guide targeting programmers, we will look at best practices for installing and customizing recent Ubuntu versions on VMware Workstation.

Introduction to Ubuntu and VMware

Ubuntu is one of the most popular desktop Linux distributions packed with development tools. As an open-source operating system…

Selecting the Optimal Ubuntu Version

Ubuntu offers both normal releases that are supported for 9 months as well as LTS (Long Term Support) versions that receive patches for 5 years. For setting up coding environments, LTS editions are strongly recommended since they prioritize stability and are ideal for production deployments.

The latest 2022 LTS is Ubuntu 22.04 codenamed Jammy Jellyfish which brings…

Ubuntu Flavors

In addition to the standard Ubuntu distributing using GNOME…

Step-by-Step Ubuntu Installation Walkthrough

Now we that basics are covered, let us install Ubuntu on a VM. I am using VMware Workstation 16 running on Windows 10 as the host OS with hardware specifications listed below:

Host Configuration

Component Specification
CPU AMD Ryzen 7 5800X
RAM 16 GB DDR4
Storage 512 GB NVME SSD
Graphics Nvidia RTX 3070

Follow along the steps to configure Ubuntu VM:

Downloading Ubuntu ISO

  1. Download Ubuntu 22.04 ISO (ubuntu-22.04.1-desktop-amd64.iso) from here

Creating New VM

  1. In VMware, click File > New Virtual Machine and configure settings like name, location etc.
  2. Allocate hardware resources to VM – I am going with 4 cores, 8 GB RAM and 40 GB disk…

Editing Configuration Before Install

  1. Enable bidrectional clipboard sharing under Options
  2. Increase dedicated video memory to 256 MB for better graphics performace
  3. Mount the Ubuntu ISO downloaded previously

Mount ISO in VM
Figure 1 – Attaching Ubuntu installer ISO before installing

Performing OS Installation

With the VM created and Ubuntu image mounted, power on the VM! The OS installation procedure is quite straightforward – pick language, select keyboard layout, choose correct timezone and add user account when prompted as shown in Figure 2 below:

Ubuntu setup prompts
Figure 2 – Ubuntu configuration before installing to disk

When it comes to disk…

Dual Booting Instead of VM

While dual booting Ubuntu alongside your existing OS like Windows…

Pros:

  • Better OS performance since hardware resources are not shared like VM
  • Direct access to all host hardware drivers and native GPU support

Cons:

  • Risk of bootloader issues that can cause failure to start systems
  • No snapshot or rollback capability in case of OS issues

Getting Started with Ubuntu VM

After Ubuntu is setup, launch the VM by clicking on the Play button. Log in using credentials you added during OS installation:

Ubuntu desktop login screen

Figure 3 shows default Ubuntu 22.04 desktop with GNOME. Next step is to optimize and customize…

Maximizing VMware Tools Integration

To get best desktop experience including smooth mouse handling, dynamic resolution and fully synced clipboards between guest and host, VMware Tools needs to installed on Ubuntu VM.

Open a terminal and use the following sequence of commands:

sudo apt update
sudo apt install open-vm-tools-desktop

When prompted, hit Yes to confirm and proceed with VMware Tools installation. This adds official VMware drivers and scripts specifically tailored for your virtual environment…

In rare cases, you may encounters errors with VMware Tools failing to install…

Alternative Installation Methods

If standard approach does not work, there are a couple of other ways to set up VMware Tools as shown below:

  1. Mount the VMware Tools virtual CD and initiate bundled installer manually – useful if internet connectivity issue
  2. Try open-vm-tools from partner PPA instead for latest patches…

Customizing Ubuntu Desktop

Now that Ubuntu VM is ready, you can customize the desktop and tooling to suit your development requirements:

Switching Desktop Environment

The default GNOME Shell interface can be sluggish at times. For a lighter and snappier coding setup, switch over to Xfce session:

  1. On login screen, click the Ubuntu logo to modify session
  2. Select Xfce option and login again

The slimmer Xfce UI consumes lesser resources so more RAM/CPU remains available for actual dev work!

Xfce desktop environment

Figure 4 shows the Xfce4 desktop environment with native Xfwm4 window manager…

Installing Essential Software

Next, open up Ubuntu Software app and install additional tools needed:

  • Git – Version control
  • Visual Studio Code – Code editor
  • LAMP stack – Web dev stack
  • Python 3, Node.js – For programming

Essential Ubuntu dev software

Figure 5 highlights some of the most useful software for coding on Ubuntu platforms. Do check out extensions like Python formatter, IntelliSense etc. to maximize coding productivity inside VS Code IDE.

More Desktop Customizations

To complete Ubuntu desktop makeover for devs, apply additional customizations:

  • Change login screen background
  • Switch to dark theme…
  • Tweak GRUB menu and splash logo

Setting up LAMP Stack

LAMP refers to a popular web dev combination that includes Linux, Apache HTTP server, MySQL/MariaDB database and PHP for server-side scripting. Let us set this up:

sudo apt install apache2 mariadb-server php libapache2-mod-php

The above command installs latest versions of the entire LAMP bundle on Ubuntu VM. Next, we also need phpMyAdmin GUI and mod_ssl for adding HTTPS encryption support:

sudo apt install phpmyadmin openssl
sudo a2enmod ssl 

Securing MySQL Installation

By default, mysql root user has no password set which is extremely insecure. So set a strong root password manually:

sudo mysql 
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘passw0rd‘;

This configures local root access with given password. Do not leave mysql unprotected!

Now our LAMP stack is correctly set up for web development complete with phpMyAdmin and SSL configuration. You can add demo pages, test projects easily from this point onwards!

Backing Up and Managing VMware Ubuntu Instances

While it is handy to simply reset VMs that run into problems using Snapshots, it is still absolutely critical to take backups particularly before making major changes.

Scheduling Auto Backups

VMware offers a handy utility called vSphere Data Protection (VDP) that can take backups of entire VMs…

Troubleshooting Common Ubuntu VM Issues

Despite the many benefits, VMs still add a layer of abstraction that can cause unique problems not faced on real hardware. However, most errors have straightforward solutions:

Graphics Glitches and Display Problems

  • Start by installing VMware Tools properly as covered previously
  • If issues persist, modify video memory assigned…

Shared Folders Not Working

  • Check if VMware services are running on the host
  • Try removing and re-adding shared folder under VM settings

Network Connectivity Drops

  • Verify if virtual network adapter is still attached
  • Revert to default NAT network connection if using custom VMnet

Be sure to check Ubuntu community forums and VMware Knowledge Base when stuck to identify commonly reported errors matching your problem scenario.

Final Thoughts

In closing, I hope this comprehensive guide helped you expertly install latest Ubuntu 22.04 LTS desktop on VMware Workstation along with essential productivity tools for developers. VMs make experimenting safe so take backups but don‘t hesitate to break things in the sandboxed environment once in a while to push your Linux skills!

Similar Posts