Setting Up VirtualBox, Explained

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

← 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 →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

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.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

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.

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?
A common reason VirtualBox cannot start any guest is that hardware virtualization, VT-x or AMD-V, is switched off in the computer's firmware. Since VirtualBox 6.1, every guest needs it. Turn on the firmware setting, often labeled virtualization technology, and try again. On a Mac with Apple silicon there is no VT-x switch, and newer VirtualBox versions run there only with guests built for Arm processors.
Why does a new VirtualBox VM keep booting into the installer?
The VM keeps booting the installer because the ISO file is still attached to its virtual optical drive, which comes ahead of the hard disk in the boot order. The firmware finds the installer disc first and starts it again. Remove the ISO from the virtual drive in the VM's storage settings, restart, and the guest boots from its own virtual disk.
How much memory should a VirtualBox guest get?
Give the guest what its operating system asks for, while keeping at least half of the host's memory for the host, a common rule of thumb. On a laptop with 8 GB of memory, that means at most 4 GB for the guest. Too much memory or too many processors makes the host freeze and the guest crawl, so lower both if that happens.
What do VirtualBox Guest Additions do?
Guest Additions are drivers and tools installed inside the guest that make it work smoothly. They let the screen resize with the window, let the mouse move freely in and out, and add a shared clipboard, shared folders, and faster graphics. To install them, choose Insert Guest Additions CD image from the Devices menu, run the installer inside the guest, and restart it.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

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

Introduction to Operating Systems
3 credits · NCCRS
Enroll →