How To Set Up A Virtual Environment – Part 1

If you’ve never used a virtual machine or VM before, you’re missing out. Particularly if you’re using the Windows environment

That’s because it’s one of the most accessible ways to run another operating system. For my purposes this is generally a Linux environment.

Now, Windows does have its own WSL, or the Windows Subsystem for Linux which allows you to do much of the same things. It literally is a virtualized Linux also. However I think there are benefits to running your own virtual machine that can be turned on and off. Usually as a server, but there’s a thousand reasons you might want to do this.

Step 1. Make sure you CAN

Not all operating systems and hardware will allow you to run a virtual machine in the first place. However in modern times most will. I think every motherboard I’ve bought in the past 15 years or so supported virtualization and I’ve made great use of that support. Like using an SSD in your computer, it’s the kind of thing I recommend to anyone who will listen.

But there’s more to it than being able to. You generally ALSO have to enable it. It’s usually disabled on motherboards by default, for security reasons.

To enable it you’ll have to restart your computer, go into the BIOS setup before your computer starts and enable it.

Giving you a guide on that specifically is beyond the scope of this particular guide because where this setting exists and what it’s called tends to vary. For best results you should look up your motherboard, but looking in your BIOS settings for something like “Enable Virtualization” or “VT-X” usually will suffice.

Step 2. Choose an operating system

Easy, right? Linux.

But what flavor of Linux exactly? Well it all depends what you want to do. If you just need to spin up a quick MySQL instance for your local network, I recommend checking out Turnkey Linux. There’s so many custom things there for you to use. You’d be shocked. Even things like network performance monitors and pre-built WordPress and CMS ISO’s. So cool.

But because I want to be pragmatic and offer you something you can configure the hell out of. I recommend we get either the Ubuntu Server or Desktop ISOs.

You can download them directly at the Ubuntu webiste.

Download your operating system somewhere and you’ll be on your way. Also if hard drive space is an issue for you. There are all kinds of low resource and compact operating systems out there for you to work with.

You can even virtualize Windows or Mac operating systems, which really comes in handy for a variety of reasons.

Step 3. Choose your virtualization software

There are a few options here. I personally use Virtual Box, and VMWare. If you’re on a mac Parallels is very popular. And There’s QEmu which relies on emulation and has a reputation of having nearly identical performance to running your OS on your hardware directly.

Because Virtual Box is open source and a long time standard that is available on all operating systems. I’m going to go with that.

Open up Virtual Box, and click “New”

Here you will configure the hardware you want to allocate to your operating system.

The requirements for Ubuntu Server are 1gb of ram, a 1ghz processor, and 2.5gb of disk space

I have about 32gb of ram so I’m going to give it 4gb. Keep in mind here that if you allocate too much your computer will be in competition for that memory and you might find your computer having to use the disk for your “host” environment, or your main operating system.

Also make sure to give it a name, select type “linux” and version “Ubuntu”. Also “Create virtual hard disk now”

Next you’ll be asked what size you want to create the virtual hard disk. I think the recommended of 10gb here is good assuming you have that much space on hand. The “Dynamically allocated” setting is also recommended here. It will allow you to only use that space as you need it on your host machine as opposed to actually taking 10gb of your hard disk now.

It’ll also ask you about the hard disk file type. I think the format here is mostly irrelevant. These are mostly for compatibility with other pieces of software. Click create and go to the next step.

Now your VM will be added in the list on the left. You aren’t finished yet though. We’ve given all of the info about the hardware but so far this is link a blank slate. It’s just a virtualized computer with no OS installed. Since we want to install an OS, we’ll need to put our virtual CD (the ISO) in the computers virtual drive, then turn it on and install it. (it’s probably worth noting here that on the Turnkey Linux site they have pre-built VM’s ready for download which can allow you to skip several of the steps here)

Click your VM then click the settings button.

Click “System” and make sure “Optical” is clicked in the “Boot Order section”

Next, click the storage section, click the “Empty” CD icon under “Controller: IDE”, and then click the cd with the arrow dropdown and click “Choose a disk file”

Browse to the ISO you downloaded in step 2 and select it

Now, we can start our virtual machine and use or install our operation system (we can usually use the operating system in a live mode where we can use it without installing anything. But when installing generally your data is persistent and saved on the hard disk between sessions, which isn’t always the case when booting a live distro)

Now, we can finally click “Start” and start our virtual machine.

You should see a boot up similar to the following

Then ultimately you should been in the OS

NOTE: When you click inside Virtual Box, your cursor will be STUCK inside of it. In order to back out of that you need to click your right CTRL and ALT keys simultaneously. The program warns you of this but it’s easy to miss.

From here I can actually start to install my operating system by running through the prompts

So, I need to fix my hyper v setup (turtle icon in the lower corner, actually mentioned somewhere else in this blog). And there is a lot more to go into with networking and such. So I’ll save that for another time, but this will get you most of the way to having a fully functional 2nd, 3rd, or nth OS as needed for your uses. The possibilities are endless.

CATEGORIES:

Tags:

No Responses

Leave a Reply

Your email address will not be published.