Building a Centralized Ubuntu Desktop for a Cybersecurity Homelab
Article Goal
In this article we will be addressing how to build a centralized PC for the purpose of managing a cybersecurity homelab. We will be adding a clean install of Ubuntu Linux Desktop 18.04 LTS to a new hard drive, connecting our fresh install to a Windows workstation through SSH, and also setting up a VNC connection between the Ubuntu PC and my primary windows workstation, and lastly installing VMware Workstation Player to set up our VMs.
Quick note: The steps and points below have been summarized to keep this part short. All resources and guides followed throughout this course will be linked when necessary. At the end of this article is a Article Links and Resources I Used, which lists all articles referenced throughout this post. You can simply follow each of these resources in sequential order and achieve the same result.
For this part of the homelab, I will be working on the Main PC, which will be the centeral envionrment where all VMs will be configured an managed.
PC Overview: Using Old Equipment
To start building the centralized environment, I decided to put my old gaming PC back into use. Compared to today’s gaming PC specs, this computer far dated, but makes for a great little server to mess around with.
If you are curious for what specs this computer has, visit the “Main PC” section in this document.
You do not need anything too powerful to centrally manage a small homelab environment. At a minimum, the device should have 8 GB of RAM, a decent processor, and a hard drive you don’t care to lose data if corruption were to happen. If you do happen to have some old device sitting around, I would recommend repurposing the equipment.
Adding a New Hard Drive
Due to having some important files on my old gaming PC, I decided to add a completely new and separate hard drive for my environment. I also saw this as an opportunity to install a new type of operating system installed onto the hard drive instead of virtualizing a similar implementation.
If you are using some old equipment and have important files stored on the current hard drive, I would highly recommend buying a new one. Hard drives are inexpensive, and you can get a sufficient amount of storage. I bought the Seagate BarraCuda 2TB Internal Hard Drive for $50 on Amazon.
Installing hard drives are easy. I disconnected the power and data cable from the current hard drive and reconnected both cables to the new hard drive and boom, done.
Installing Ubuntu Desktop 18.04 LTS on Clean Hard Drive
In order to install a clean image of Ubuntu on a new hard drive, you first must have a fully downloaded ISO image on a bootable device (flash drive, CD, etc). From there, we can format our bootable drive to have a fully installed image of Ubuntu. Once we have our bootable drive installed with Ubuntu, we will have to enter the BIOS of the motherboard and ensure to boot from installed drive.
Step One: First download the ISO image from the official Ubuntu website and have a clean flash drive or CD ready to go.
Step Two: Follow this simple guide to create a bootable Ubuntu USB stick from the official Ubuntu website. (If you are using a CD, make sure to burn the ISO onto the correct type of CD).
Step Three: The bootable flash drive is ready to go. Plug the flash drive into the computer when its powered off.
Step Four: Turn on the computer and use the hot key to enter the BIOS of the motherboard immediately after turning on. The hot key will vary depending on the motherboard manufacturer, if you do not know the shortcut, look up the motherboard make and model.
Step Five: Now we should be in the BIOS of the motherboard. Every BIOS is a little different depending on the motherboard. In general, to install Ubuntu onto a new hard drive, navigate to the motherboard’s settings option and find a section titled “Boot.” Once you are in the Boot section, you should see a “priorities” list which lists a certain number of Boot option priorities. Place the USB hard drive in the “1st Boot” option, followed by the hard drive name in the “2nd Boot” option. Often times, the motherboard will automatically place the USB hard drive before the hard drive. Once this is done, you can exit out of the BIOS and restart the machine.
Step Six: The machine will reboot and should open an Ubuntu installation screen after a few moments. Go through the initial setup wizard and make sure to click the defaults options.
Step Seven: After you walk through the setup wizard, you should have an installation of Ubuntu on the hard drive!
Connecting to Desktop Through SSH
Connecting Ubuntu Desktop through SSH is simple. To enable SSH on Ubuntu, we first install the openssh-server, followed by ensuring our SSH service is on. Follow this small guide for more detail on enabling SSH on Ubuntu. This small setup allows us to only SSH within the same network.
$ sudo apt update
$ sudo apt install openssh-server
$ sudo systemctl status ssh
Once we have installed openssh service on Ubuntu, we then need to get the IP address of the machine by typing ip addr show
We can now connect to our Ubuntu machine through SSH. In the example below, I use PuTTY on my Windows 10 workstation and connect through SSH (port 22).
And success! We have not got a stable SSH connection between the Ubuntu Desktop device and my windows workstation.
Setting up VNC connection
Remoting into the Ubuntu through SSH can be great if we want to apply some small configurations and check the status of a service… If we want to have a more intuitive experience, working with the user interface and graphical screen, we can set up a Virtual Network Computing (VNC) service to have remote access to our Ubuntu machine.
There are several VNC service providers which provide quality and easy service setups. We will be downloading and working with RealVNC VNC Connect to provide a VNC connection from our Windows workstation to the Ubuntu machine.
Before we install and setup RealVNC, let’s go ahead and enable VNC on the Ubuntu machine.
Ubuntu comes pre-installed with a VNC server, so we do not have to worry about downloading a service on this side.
Setting Up Ubuntu with VNC
To setup VNC on Ubuntu, we will be enabling the screen sharing feature. Follow this simple guide to turn on screen sharing and make sure to require a password upon log in.
Remote into Ubuntu Machine with RealVNC
Download the RealVNC client on the download page and follow the default instructions.
Once VNC Connect has been installed, go up to “File” and choose “New Connection”
A Properties Window should appear… Type in the IP address or hostname you set up with the Ubuntu Desktop followed by the Name as a identifier within the VNC Connect client.
Under the “Security” options, uncheck both security checkboxes. Click “OK” after finished and then right click the new window, choose “Connect.”
And success! Now we can have remote access to our centralized homelab computer through both SSH and VNC.
Downloading VMware Workstation Player
For the Cybercademy Cybersecurity HomeLab Project, I will be using VMware Workstation to centrally manage my virtual machines. I will not be installing a type 1 hypervisor (also known as bare metal hypervisor) in this project. Instead, I will be centrally configuring and managing the workstations and services through VMware Workstation.
To install VMware Workstation, I followed this simple guide.
To sum up this guide in 3 commands, you need to first download the getworkstation bin from VMware. Install a prerequisite package called Build Essential. Then launch the install and go through the default Wizard. You can do this through the command line in three commands.
$ wget -O ~/vmware.bin https://www.vmware.com/go/getWorkstation-linux
$ sudo apt install build-essential
$ sudo bash ~/vmware.bin
And boom, we now have VMware Workstation Player.
Summary
In the very first our of the Cybercademy Cybersecurity Homelab project, we have successfully installed a centralized computer, set up with Ubuntu Linux, where we will be able to remotely manage our lab through other workstations (on the same network), and installed VMware Workstation Player to centrally configure our VMs.
The next part of this project is to set up an Active Directory (AD) Virtual Machine environment where we will connect our user workstations, RDP service, and our security services together.