Tag: virtual Machines From Zero

  • Virtual Machines From Zero: Run a Second Computer Inside Your First

    Virtual Machines From Zero: Run a Second Computer Inside Your First

    This guide covers virtual Machines From Zero.

    Virtual Machines From Zero: Run a Second Computer Inside Your First
    Photo: geralt / 16967 immagini, CC0, via Wikimedia Commons

    A virtual machine is a complete computer that exists as software. It has its own virtual CPU, memory, disk and network card, it boots its own operating system, and it can crash, get infected, or be deleted — without taking your real machine with it. That isolation is why every security lab, every Linux course, and every careful experiment starts the same way: build a VM first. This guide explains the moving parts from primary documentation, then walks the first build in the order the manuals themselves use.

    The two words that explain everything: host and guest

    Oracle’s VirtualBox User Guide defines the vocabulary plainly. The host operating system is the OS of the physical computer VirtualBox is installed on. The guest operating system is the OS running inside the virtual machine. The virtual machine itself is the special environment VirtualBox creates for the guest while it runs.

    Between them sits the hypervisor — the software that creates and runs VMs. VirtualBox’s own documentation calls itself a “hosted” hypervisor, also known as a Type 2 hypervisor: it requires an existing operating system to be installed, and runs alongside your normal applications. A Type 1, or bare-metal, hypervisor is the other class: it runs directly on the hardware, with no host OS underneath. VMware ESXi and Microsoft Hyper-V in its server role are the familiar Type 1 examples; VirtualBox and VMware Workstation on a desktop are Type 2. Neither class is “better” in the abstract — Type 1 is built for data centers that dedicate a machine to virtualization, Type 2 is built for a person who wants a lab on the laptop they already own.

    Most modern CPUs include hardware virtualization support — Intel VT-x and AMD-V — which the hypervisor uses to run the guest efficiently. If a first VM is painfully slow or refuses to start, that setting, usually toggled in the machine’s BIOS or UEFI firmware, is the first place the documentation tells you to look.

    Why a VM is the safest room in the house

    Three properties, all documented features of the platform, do the work:

    • Isolation by default. The guest sees virtual hardware, not your real disk. A program inside the guest cannot reach host files unless you deliberately create a shared folder or enable a shared clipboard or drag-and-drop — which is exactly why the safe default for an untrusted guest is to leave all three off.
    • Snapshots. VirtualBox documents snapshots as a saved state of a VM that you can return to later. Take one before an experiment and a bad install, a broken update, or a suspicious download becomes a revert, not a rebuild.
    • Disposable networking. A VM’s default network mode in VirtualBox is NAT: the guest can reach the internet through the host, but the internet — and, by default, other machines on your LAN — cannot reach in. Other modes exist for a reason (bridged networking puts the guest on your LAN as its own citizen; host-only networking isolates it to talk only to the host and sibling VMs), and choosing one should be a decision, not an accident. For a first lab, NAT or host-only is the honest default; bridged is for when you actually mean it.

    That combination is why Kali Linux’s own documentation steers learners toward its pre-built VM images: the lab arrives pre-installed, isolated, and resettable, and the host stays clean.

    Virtual Machines From Zero: Run a Second Computer Inside Your First
    Photo: Diego Carvalho, CC BY-SA 4.0, via Wikimedia Commons

    Your first VM, in the manual’s order

    1. Install the hypervisor from its official source. VirtualBox is free from Oracle; download it for your host OS and, if you need USB 2.0/3.0 and other extras, the matching Extension Pack from the same page.
    2. Get a guest ISO from its maker — only from its maker. Ubuntu from ubuntu.com, Kali from kali.org, Windows from Microsoft. An OS image from anywhere else defeats the entire point of an isolated, trustworthy lab.
    3. Create the machine. Name it, point the wizard at the ISO, and size it honestly: for a desktop Linux guest, 4GB of RAM and 25–40GB of virtual disk is a workable start, using a dynamically allocated disk so the file grows only as the guest actually uses it. Give it too little RAM and both host and guest suffer; give it half your machine and the host still suffers.
    4. Before you install anything risky, set the boundaries. Network on NAT or host-only. Shared folders, shared clipboard and drag-and-drop off unless the task needs one of them — and then on for that task only.
    5. Install, update, then snapshot. The clean, fully updated state is the one you will wish you could return to. Name the snapshot for what it is (“clean install, updated”) and take it before the first experiment, not after the first problem.
    6. Install the Guest Additions (VirtualBox) or the equivalent tools package for your hypervisor. This is the guest-side software that makes resizing, display, and host integration work properly — the step beginners skip and then blame the hypervisor for.

    The mistakes that teach the wrong lesson

    • Treating a VM as invincible. A VM isolates the host from the guest. It does not make the guest itself safe: a phished password typed inside a VM is still phished, and a guest in bridged mode is a real machine on your network, patchable and attackable like any other.
    • Sharing everything for convenience. Every shared folder is a bridge across the isolation you built the VM for. Bridges are tools; build one when you need it, remove it when you don’t.
    • Never snapshotting, or snapshotting and never testing the revert. A snapshot you have never restored is a hope, not a backup.
    • Running two hypervisors at once. VirtualBox’s own manual cautions against running other hypervisors together with it — on modern Windows, features built on Hyper-V can coexist in specific configurations, but unexplained slowness or start failures are often two virtualization layers negotiating, badly.

    The bottom line

    A virtual machine is not a trick and it is not advanced. It is the standard room where computing experiments belong: cheap to build, honest about its boundaries, and deletable without grief. Learn the four words — host, guest, hypervisor, snapshot — install from official sources, keep the guest isolated until you have a reason not to, and you have the foundation every later lab in this series stands on: Kali for security work, Ubuntu for Linux fundamentals, Windows for testing — each in its own room, none of them able to burn down the house.

    By Karl Amber

    Sources

    • Oracle VirtualBox User Guide (Release 7.1/7.2), “First Steps” and “Features Overview” (docs.oracle.com / virtualbox.org manual): host OS, guest OS and virtual machine definitions; VirtualBox as a hosted (Type 2) hypervisor versus bare-metal (Type 1); snapshots; NAT, bridged and host-only networking; Guest Additions; the caution against running other hypervisors together.
    • Kali Linux Documentation (kali.org/docs): official VM images and virtualization guidance for running Kali as a guest.
    • VMware / Broadcom product documentation: ESXi as a bare-metal (Type 1) hypervisor reference point, and Workstation as a desktop (Type 2) reference point.

    Editor’s note: this article is part of ScanderLoud’s Cybersecurity & Networking series. It was researched from the hypervisor vendors’ own documentation — our coverage is original.

    That is the complete picture on virtual Machines From Zero.

    Featured image: No machine-readable author provided. METROID~commonswiki assumed (based on copyright claims)., Public domain, via Wikimedia Commons