Experiment with software using virtual machines. This is how.

Image for post
Image for post

Virtual machines are powerful pieces of software that offer a plethora of use cases for everyone ranging from those of us who use computers for “office” work to software and hardware engineers who employ deep knowledge of software engineering and computer design. Chances are that if you are an IT professional, you are already familiar with virtual machines and probably use them in some form on a daily basis. This article will focus on the readers who either don’t know what a virtual machine is, how to use one, or both. Further, this article focuses on setting up a virtual machine on macOS. If you are on Windows or another operating system, the idea is the same, but the installation steps differ.

A video form of this write-up is available here if you prefer.

What are virtual machines?

Virtual machines allow you to essentially create another computer within your existing computer. Look at the picture at the top of this post. You can see the default macOS Catalina desktop with an application window open. That application is a running a virtual machine using Parallels software. Just like you can have Microsoft Excel or Apple Pages or any other application running in its own window, a virtual machine is an application that lets you run a whole operating system within a window just like shown in the picture, effectively giving you a virtual computer within your computer to work with.

Why use a virtual machine?

Like I said at the beginning, there are many potential uses of virtual machines, but let’s explore two practical uses for macOS users.

Testing out software you are not sure is entirely safe

Say that you need to install some software that you download from a website as opposed to from the Apple App Store. Downloading from such a source might be insecure. You don’t know the company or the developers who wrote the software and Apple didn’t vet their product on your behalf like they do in the App Store. Consequently, there is a higher risk that the software might do some form of harm to you computer. Sure, it might install a virus, but there are other risks as well. For example, the software might change your macOS configuration in a way that might negatively impact your computer usability or the software might be difficult to uninstall. To protect yourself from such a risk and to lower the risk that a potentially harmful software does a damage to your macOS installation, you can install it in an isolated virtual machine instead. That way, the harm such software can do to your computer is significantly lowered, if not fully avoided.To be clear, if the installed software. contains a virus, depending on the nature of the virus, the virtual machine may or may not be able to protect your computer. However, running the software in an isolated way lowers the risk. If the software applies some undesired system reconfiguration, the virtual machine will protect your main macOS installation.

If the software turns out to be one you don’t want to have in your computer, you simply erase the virtual machine, which will erase all traces of the software and any system changes the software might have applied to your computer with it. No need to worry about how to clean up the mess.

Playing with complex configuration settings

This one usually applies to engineers, but can apply to more advanced non-engineer users as well. Say that you need to configure your macOS in some complicated way or install some software that requires a complex configuration. What if things don’t go well during the configuration and you want to undo it? Well, if you don’t take step by step notes on what configuration changes you applied, it might be very difficult to trace your steps and undo the changes. Why not spare yourself the pain and first try the installation/configuration in a virtual machine. If things don’t go well, you will simply erase the virtual machine and start over. If things do go well, you’ll know how to do it correctly on your main macOS installation outside the virtual machine.

Virtual machine software

To install a virtual machine on macOS, you have multiple software options. These range from the freely available VirtualBox to a high-performance paid options such as Parallels. We will use Parallels because it’s a much better software than VirtualBox or other free alternatives for macOS. Parallels isn’t free, but it’s worth every penny. When you run a virtual macOS (or any other operating system, such as Windows or Linux) in Parallels, the performance of the virtualized macOS will be nearly indistinguishable from the base macOS installation on your computer.

Parallels installation steps

To install Parallels, head to https://www.parallels.com/ and and click on Download Free Trial.

Image for post
Image for post

Once the software package downloads, double-click on it to start the installation process.

When the following window pops up, click on Install.

Image for post
Image for post

You will be presented with an option to install MS Windows. Our goal is to install a macOS virtual machine, so we will skip this step by clicking on the Skip button.

Image for post
Image for post

Next we’ll be presented with Installation Assistant shown below.

Image for post
Image for post

Now, before we continue with the installation, let’s customize things a bit. Running a virtual machine on a computer takes a good amount of disk space. For example, the fresh installation of macOS in Parallels consumes about 60 GB of disk space. That’s quite a bit for some of us. For example, my computer has 500 GB of disk space and my files already occupy about 70% of it. Installing a 60 GB virtual machine (twice on top of it, I’ll explain why later) will consume uncomfortably large amount of space. Therefore, I decided to install it on an external USB disk drive that I have. You can get one easily on Amazon these days. I use this one if you need a recommendation. If you don’t want to install the virtual machine on an external drive, skip the following step and go straight to the macOS virtual machine installation using the Installation Assistant step below.

Image for post
Image for post

Ok, plug your USB drive to the USB port and wait for the icon to appear on the desktop. Then go to Parallels preferences by clicking on Parallels in the top menu and selecting Preferences from the menu options.

Image for post
Image for post

Next click on the little lock icon to unlock the settings so that you can make changes.

Image for post
Image for post

It will ask you for your computer password. Enter it and press enter.

Once the screen is unlocked we will change the “Virtual machines folder” setting and point to your external drive.

Image for post
Image for post

To do that, click on the drop down box and choose “Other” from the options.

Image for post
Image for post

Once the file finder window appears, find your external drive in the left pane. My external drive is called “Windows 10” in the screenshot below. Don’t let that confuse you. This is because when I bought the drive, I used it to install a Windows 10 virtual machine on it, so I named it correspondingly. In this tutorial, I will add macOS to it side by side with Windows 10. Your external drive will very likely be called something else.

Image for post
Image for post

Once you select your drive, click on the Open button. Notice that the path in the “Virtual machines folder” setting change to the path pointing to your external drive.

Image for post
Image for post

Click on the lock icon again to lock the settings and close the window.

Creating a macOS virtual machine

We are back at the Installation Assistant. From here, we will let Parallels know that we want to install a copy of the macOS that is currently installed in your computer.

Image for post
Image for post

To do that, click on the arrow pointing to the right as indicated in the above picture until you see the option “Install macOS 10.15.6 Using the Recovery Partition”. Mind that you will likely see a different OS version on your screen. Don’t worry about it, select that option and click on Continue.

Image for post
Image for post

On the next screen, click on Install.

Image for post
Image for post

Parallels will spend a few minutes installing your new macOS virtual machine.

Image for post
Image for post

Eventually, it will restart and present you with a new macOS installation wizard. It will ask you to choose what language you want your macOS to use to communicate with you. Pick the option that suit you, probably United States.

Image for post
Image for post

On the next screen, choose the “Reinstall macOS” option. Don’t worry, this is not going to reinstall your computer’s main macOS installation. All these steps apply exclusively to the virtual machine that we are creating.

Image for post
Image for post

The next screen present you Terms and Conditions. Accept those.

Image for post
Image for post

On the next screen, choose the Macintosh HD drive as the destination drive in which macOS will be installed. This actually points to the external drive we plugged into the USB port and configured Parallels to use it earlier.

Image for post
Image for post

Click on the Install button. The installation process will take some time.

Image for post
Image for post

The virtual machine will restart along the way. Eventually, you’ll be presented with the following region selection window. Pick your region and continue. The wizard will present you with a few more configuration windows. Set the preferences you like as you go through them. We won’t go through them all here. If you’re uncertain what setting to choose, leave the default setting as is.

When you get to the iCloud sign in page, just skip it for now by clicking on the “Set Up Later” link.

Image for post
Image for post

On the account creation page, enter the user’s full name and password that you like. It’s recommended to use complex passwords containing a mix of uppercase characters, lowercase characters, numbers and special characters.

Image for post
Image for post

As you go through the configuration pages, eventually you see a clean desktop of a new macOS installation looking like this:

Image for post
Image for post

Congratulations! You just installed a virtual machine running macOS on an external USB drive.

While you can now start using this virtual machine as is, it’s recommended to set a few more things up to make the user experience pleasant.

Install Parallels Tools

First thing is installing Parallels Tools. It’s a software that will create a seamless connection between your main computer macOS and the macOS running inside the virtual machine. It will allow you to do things like expand the virtual machine window to full screen. It will also create a folder icon on your virtual machine macOS desktop. When you drop files in that folder, you’ll be able to access those folders from the main macOS on your computer and vice versa.

To start the Parallels Tools installation, click on the yellow triangle icon in the top right and choose “Install Parallels Tools” from the menu.

Image for post
Image for post

When you see this page, click on Continue.

Image for post
Image for post

A new drive will be added to the virtual machine desktop. Double click on it to start the installation process.

Image for post
Image for post

Next click on the Install icon in the Parallels Tools window.

Image for post
Image for post

The installation will start. You’ll be asked to enter your password along the way and eventually you’ll be asked if it’s okay to restart the virtual machine. Click on Restart.

The virtual machine will restart and Parallels Tools will be installed and running.

Let’s shut down the virtual machine by clicking on the Apple icon and choosing “Shut Down…” from the menu as usual.

Image for post
Image for post

Cloning a clean copy of the macOS virtual machine

Okay, now that we have the virtual machine all set up, let’s talk about how to use it well. Since this is a clean installation, we should preserve it and not install any experimental software or apply any complex configuration to it. We should use this installation as a clean starting point for all our future work. Whenever we want to test something out in a virtual machine, we will first create a clone of this clean virtual machine and then work with the cloned one. When we are done, we will simply delete the cloned machine. Let’s go through the process of how to create a copy of the virtual machine.

In your main computer macOS, click on the red double bar icon in the top right and choose “Control Center” from the menu.

Image for post
Image for post

You’ll be presented with a list of available virtual machines. We just installed our first one, so you should see only one item there.

Image for post
Image for post

Right click on the macOS 10.15.6 (again, your version number might be different) and select “Clone” from the menu.

Image for post
Image for post

You’ll be presented with window naming your cloned virtual machine. The default name is “Clone of macOS 10.15.6”. We’ll just leave it at that, but you can name it whatever you want, of course.

Image for post
Image for post

Click on Save. The clone will get created — it wall take a minute.

When it’s created, you’ll see it in the Control Center like this:

Image for post
Image for post

The second item, “Copy of macOS 10.15.6” is the cloned virtual machine that we can freely do any experimental work on because we’ll simply erase it when we are done. Let’s start the machine. Click on it in the menu. A window with a large play icon will show up to the left. Click on the play icon to start the virtual machine. After a moment, the machine will boot up and ask you for the password. Enter the same password you specified for the first virtual machine installation.

When the virtual machine fully loads, you’ll see a screen like this one again:

Image for post
Image for post

Now you can resize the window to use up the full screen real estate. Simply grab it by its corner with a mouse just like any other application window and resize it to your liking.

Image for post
Image for post

And that’s it. Use this clone of the virtual machine for your work. When you’re done or if things go poorly and you need to start over, simply shut down the machine, erase it and create a new clone. Let’s look at the last step — erasing a virtual machine. First, shut this one down using the Apple icon and the “Shut Down…” option from the menu as usual.

Erasing a cloned virtual machine

To erase the cloned virtual machine, go to the Control Center again, right-click on the cloned virtual machine and choose “Remove “Copy of macOS 10.15.6”” from the menu.

Image for post
Image for post

When you do that, you’ll be asked if you want to keep the virtual machine files or delete them. Since we want to completely erase this clone, click on the Move to Trash button.

Image for post
Image for post

And that’s it! The virtual machine is erased. If you need to do something in the virtual machine in the future, simply clone the original virtual machine again, start up the clone and do what you need in it. When you’re done, shut it down and erase it to clean up.

I hope you found this article useful. If you’d like to be informed about new articles or youtube videos, follow me on:

Written by

Software and hardware engineer, tech entrepreneur (https://petrkout.com, @petrkout)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store