From the course: Learning Linux Command Line

Creating a Linux virtual machine - Linux Tutorial

From the course: Learning Linux Command Line

Creating a Linux virtual machine

- [Instructor] If you don't have access to a Linux computer and you're not able to use GitHub Code Spaces, another option for following along with me here is to set up a Linux virtual machine on your computer. Working in a virtual machine allows us to keep our learning work separate from our real computer, so we're free to make changes and mistakes that won't affect anything else, though it's a bit more work to get up and running. I think it's worth the effort though. You can decide for yourself. There are many tools that allow us to create a virtual machine, and one of them that we can use on Windows, Linux, or Mac Systems is called VirtualBox. VirtualBox is free for personal use and it makes building and controlling a virtual machine pretty straightforward. In this video, I'll show you briefly how to install Ubuntu Desktop in VirtualBox on a Windows PC. If you have other preferences, by all means use the distribution or other software of your choice, but you'll be on your own for installation and troubleshooting. We can get the files we need from virtualbox.org Ubuntu.com. If you choose to use different software or different distro, you'll need to download the files your software choices require. Let's take a look at the process of setting up a virtual machine. Depending on the speed of your hardware, this could take up to 20 minutes or so. Here's the VirtualBox website at virtualbox.org. And I can click the big blue button here to download the current version. There's a few different options for the platform, so if you're using Windows, click the Windows one, and if you're using a Mac, click the appropriate option for your system. I've downloaded this file so I'll open it up. Here I'll move through the installer. When the process is done, I'll click Finish. Then I'll head over to Ubuntu.com and download the installer for the operating system, I'll find Download Ubuntu, and here under the Desktop section, I'll click Download Ubuntu Desktop. My computer has an Intel processor, so I'll choose this download. If your system uses a different architecture, you'll need to check out the alternative downloads. I'll click Download. This is a pretty big file, so it might take a few minutes to download. When that's done, I'll close my browser, and I'll find the VirtualBox manager software. I'll click on the New button and it'll create a virtual machine. I'll give my virtual machine a name. In this case, Ubuntu Desktop. And under the area labeled ISO Image, I'll click Other. I'll browse to my downloads and I'll click the installer image that I just downloaded. Then I'll choose Skip Unattended Installation. I'll open the hardware section, and I'll provide an amount of memory for the system to use. In my case, I'll use 8,192 megabytes. That's eight gigabytes of memory. And in the CPU section, I'll give my system four processor cores. You'll need to make choices based on the hardware you have, but this is about the minimum that I'd recommend. Then I'll open the hard disk section, and here I'll set how much space the virtual machine's disc can use. I'll set this to 64 gigabytes. This creates a virtual disc image that we'll erase later, but it won't affect anything else that's on your system. When I've set that, I'll click Finish. And then I'll click Start. Depending on your monitor, the view here might be a little bit small, so to change the zoom, I'll click on View, and then I'll choose Virtual Screen 1. Here I have a variety of options for scaling the display. I'll start out with scale to 200%. Well, that's a little small. Let's zoom in a bit more, maybe 300%. That's better. Here I'll choose Try or Install Ubuntu and press Enter. It looks like my zoom isn't quite right, so I'll double click the title bar here, and then I'll click View, Virtual Screen, and I'll zoom out a little bit. I'll try 250%. There we go. And now I'll move through this installer. I'll click Next a few times and then I'll skip this prompt. I'll make sure Install Ubuntu is selected and click Next. I'll use the interactive installation with a default selection, and then I'll move forward. Now, I'm prompted to erase the disk and install the operating system. This will erase the virtual disc that we just created, and there's nothing on it anyway, so I'll click Next. Don't worry, none of your files will be affected. Then I'm asked to create an account, so I'll provide my name and I'll set the name of my computer. I'll call this one Linux VM. Then I'll set a username that I'll use to log into the system. I'll just use my first name here, and then I'll set a password. I'll confirm that password, and then I'll click Next. I'll make sure my time zone is set appropriately and I'll click Next. Then we're ready to install, so I'll click the Install button. This process can take a while, so we'll speed up the video here. Okay, our installer's done, so I'll click Restart Now. Then I'll press Enter. I will click on my username and I'll type in the password I set during the installation process. Then I'll move through these introductory screens. Throughout the course, we'll be working with the command line shell in a terminal application, so I'll need to open my terminal. To do that, I'll click on this area here in the top left and then start typing the word terminal. Alright, T-E-R, and there it is. I'll click on the Terminal. I'll make this font a little bigger with Ctrl + Shift +. You can change the colors of the terminal here if you'd like by right clicking in the terminal window and choosing Preferences. And then here in the profile section, under the unnamed profile, I'll click on Colors and I can make a selection. I'll close out of here and I'll double click the menu bar to make this window bigger. Great, there's a terminal we can work with. The next thing we need to do is to get the exercise files for this course downloaded to the system. So to do that, I'll open up Firefox, the web browser that's included with Ubuntu Desktop, and I'll go to GitHub to download the exercise files for the course. If you don't have a GitHub account, you can download the files from the LinkedIn learning course page. Look for a link called Exercise Files. Here on GitHub, I'll find the green code button, I'll click it, and then I'll choose download zip. I'll close my browser. I'll open the file browser and I'll click on My Downloads. Here I'll right click on the file and choose Extract. This creates a directory and I'll open that up. Here I see the exercise files directory, so I'll drag those into my documents directory. That's where I'll be using them for the rest of the course.

Contents