UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 10.5 Free with a free account
Setting Up VirtualBox
Introduction to Operating Systems · Chapter 10: Virtualization and Virtual MachinesSection 10.5 · lesson 82 of 838 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Introduction to Operating Systems.
Lesson complete
Earn the 3 college credits for Introduction to Operating Systems
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: The Java Virtual Machine →← How Virtual Machines Replicate an OSNext lesson: The Java Virtual Machine →
A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →
In this lesson
Five steps to create, install, and protect a first virtual machine.
- Check a host for virtualization support, memory, and disk space
- Create a VirtualBox virtual machine and install a guest from an ISO file
- Install Guest Additions and take a snapshot of a clean guest
- Troubleshoot common problems such as boot loops and slow guests
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (1,141 words). Read along, or search it.
Opening Scene
A Second Computer in Half an Hour
Sam, who runs a small online bakery, is ready to make a first virtual machine. Ivy, who looks after the computers at a school, sits alongside. With a free tool, an installer file, and about half an hour, you can have a second computer running in a window, and delete it again if you don't like it. Here are the steps in order, with the reason behind each one, so you're never just clicking. Menus differ a little between versions, so look for the ideas, not the exact words.
Roadmap
Five Steps in Order
Five steps. Check that your computer is ready. Install VirtualBox. Create the virtual machine. Install the guest system. Then add Guest Additions, and take a snapshot.
Step One
Virtualization, Memory, and Disk Checks
Step one: is your computer ready? A guest means running two computers on one set of hardware, so check three things. First, virtualization support. Most PC processors have VT-x or AMD-V, from lesson 10.3, but the firmware, from lesson 1.9, can ship with it switched off. Since VirtualBox 6.1, every guest needs it. With it off, VirtualBox can't start a guest at all. The firmware setting is often called virtualization technology. Second, enough memory. Host and guest share the real memory. A common rule of thumb: keep at least half for the host, and give the guest what its system recommends. Third, enough disk space. The guest's disk is a file, from lesson 10.4, so leave room for the installer, the guest's system, and its growth. On a Mac with Apple silicon, there's no VT-x switch. Newer VirtualBox versions run there, but only with guests built for Arm processors.
Step Two
Install from the Official Website
Step two. Download VirtualBox from its official website, never from an advertisement or a stranger's link. A fake installer could be malware, from lesson 9.1. Run the installer and keep the defaults unless you know why to change them. It may ask for an administrator password, since it adds a driver to the host, from lesson 5.6. Your network may flicker for a moment, while it adds virtual network adapters. Then open VirtualBox. You'll see a manager window, with an empty list of machines, and buttons such as New and Settings. And keep the host updated. A type 2 hypervisor is only as safe as the system under it.
Step Three
The New Machine Wizard
Step three: click New. A short wizard asks a few questions, and each answer maps to something from lesson 10.4. A name: something clear, like Linux practice. The type and version: the system you'll install, so the tool picks sensible virtual hardware. Memory: what the guest system recommends, within your limit. Processors: one or two virtual CPUs to start. And a virtual disk: a new one, dynamically allocated, big enough for the system. It's a file that grows.
Step Four
Booting the Installer from an ISO
Step four. A brand-new VM is like a computer with a blank disk and no operating system. It has nowhere to start from. You give it a starting point with an ISO file: a single file that's an exact copy of an installer disc. Get it from the guest system's own official website. Attach the ISO to the VM's virtual optical drive, in its storage settings. Newer versions also let you pick the ISO right in the New wizard. Then press Start. A window opens, the virtual firmware looks for something to boot, finds the installer disc in the optical drive, and starts it, as in lesson 1.9. Follow the installer as on a real computer: a language, a user name and password, and the whole virtual disk. That erases only the virtual disk, never your real one.
Quick Check
Why the Installer Keeps Returning
Quick check. Sam's install finishes, and the guest restarts. But the installer's welcome screen appears again, as if nothing had happened. What's the most likely cause? Pause, and decide. The ISO is still in the virtual drive. The VM's boot order puts the optical drive ahead of the hard disk, so the firmware finds the installer disc and boots it again. Remove the ISO from the virtual drive, and the guest starts from its own disk. Missing Guest Additions only make the screen and mouse clumsy. And with VT-x off, the guest wouldn't have started at all.
Step Five
Guest Additions and a First Snapshot
Step five. Your guest works, but it may look small and clumsy. Install the Guest Additions, from lesson 10.4. With the guest running, open the Devices menu, and choose Insert Guest Additions CD image. Run its installer inside the guest, then restart the guest. Now the window resizes, the mouse moves freely, and you can share a clipboard or a folder. Then take your safety net: a snapshot. Name it for the moment, such as Fresh install with additions. Whatever you break later, you can roll back to this clean moment, from lesson 10.2. A VM is a safe place to learn: break things on purpose, and roll back.
Troubleshooting
Five Common Problems and Fixes
When a new VM misbehaves, a few causes cover most problems. No guest will start? Check the firmware's virtualization setting. The guest crawls and the host freezes? Too much memory, or too many processors, was given. Lower both. The installer loops after a reboot? Remove the ISO. No internet in the guest? Try NAT first. A small screen and a stuck mouse? Install Guest Additions, and restart.
Quick Check
Memory for a Guest on 8 GB
Quick check. Ivy's laptop has 8 gigabytes of memory. She wants to hand a guest as much as she can. But she must keep at least half for the host. How much should she give? Pause, and decide. Four gigabytes. Half of eight is four, so that is the most the rule allows, and it leaves four for the host. Six would starve the host: it slows down, and the guest with it. Two is safe, but it is not the most.
Good Habits
Keeping a Virtual Lab Healthy
A few habits keep a virtual lab healthy. Shut a guest down from inside, like a real computer, so its file system is saved cleanly, from lesson 6.2. Clone a good guest to start a new experiment. Delete guests you no longer use, since each keeps a disk file on your host. And update each guest's own system. And remember, a guest is a file. Most tools can export it, and import it on another computer: the same fact behind disaster recovery in lesson 10.2.
Story Ending
A Flat Inside the Flat
Back to Sam, who named the guest, gave it two processors and four gigabytes of memory, and let its disk grow as needed. Sam attached the installer, clicked Start, and watched a second computer boot in a window on the bakery laptop. It's like a flat inside the flat, Sam said.
Key Takeaways
VirtualBox Steps Reviewed
To recap. Check first: virtualization on in the firmware, enough memory, and enough disk space. Install VirtualBox from the official site. Create the VM with a name, memory, processors, and a growing disk, then boot the installer from an ISO. Add Guest Additions and take a snapshot. And when something goes wrong, check the firmware, the ISO, and the sizes first.
About Introduction to Operating Systems at UPI Study
Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: Linux vs Operating Systems
Why take it here
Why students take Introduction to Operating Systems with UPI Study
Where the credit goes
Universities that work with NCCRS
Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Setting Up VirtualBox
Why won't VirtualBox start a virtual machine?
Why does a new VirtualBox VM keep booting into the installer?
How much memory should a VirtualBox guest get?
What do VirtualBox Guest Additions do?
About the Introduction to Operating Systems course
How many college credits is Introduction to Operating Systems?
How much does Introduction to Operating Systems cost and what is included?
Which universities accept UPI Study credits?
How long does Introduction to Operating Systems take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Introduction to Operating Systems.
83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →