Overview
The session introduces virtual machines with a focus on VirtualBox. It explains benefits for testing, key features, setup steps, networking modes, Guest Additions, shared folders, and snapshots.
Use Cases and Benefits of Virtual Machines
- Test desktop applications across multiple operating systems without multiple devices.
- Maintain a clean environment free from personal files and applications.
- Isolate testing to protect the host system and files from unintended changes.
- Run multiple operating systems and browsers simultaneously on one host.
- Restore system state quickly using snapshots after harmful application behavior.
- Emulate hardware configurations without purchasing physical components.
Installing VirtualBox and a Virtual Machine
- Download and install VirtualBox from the official source.
- Obtain the operating system image from official, trusted resources only.
- For Windows 11, download the disk image matching the VirtualBox platform.
- Import the downloaded image in VirtualBox using default settings.
- Initial launch may take significant time; be patient.
Alternative Manual VM Creation
- Create a new virtual machine via the guided setup in VirtualBox.
- Configure hardware setup and select virtual hard disk size.
- Apply necessary settings as required by the use case.
VirtualBox Settings Overview
- Access settings from the VirtualBox interface; some require the machine powered off.
- Configure key areas such as network, shared folders, and display options.
- Understand that not all settings are editable while the VM is running.
Networking Modes in VirtualBox
- NAT (default): VM has network access if host has access; no external access to the VM.
- NAT Network: Similar to NAT; all VMs in the NAT network can see each other.
- Bridged Adapter: VM is a full local network member with its own IP; visible to other devices.
- Internal Network: Guest systems see each other only; no host or external network access.
- Host-Only: Guests can see the host and each other; no external network access.
Bridged Adapter Considerations
- Security risk without antivirus or firewall; VM exposed to external threats.
- Consumes IP addresses; can exhaust available addresses in company environments.
- Rare risk: A DHCP server on a guest could assign IPs to devices and disrupt the network.
Guest Additions
- A set of drivers and tools installed on the guest operating system.
- Improves usability and integration between host and guest systems.
- Enables features: drag and drop, shared clipboard, mouse pointer integration, custom window size, shared folders.
- Install via Devices menu: Insert Guest Additions CD image when not pre-enabled.
Shared Clipboard and Drag and Drop
- Enable from Devices menu with bidirectional mode for both features.
- Shared clipboard allows copy-paste between host and guest.
- Drag and drop allows file transfer between host and guest windows.
Shared Folders
- Appears as a network folder inside the guest; as a normal folder on the host.
- Setup steps:
- Open Settings > Shared Folders.
- Add a shared folder; set folder path and name.
- Uncheck Read-only; check Auto-mount; leave mount point blank if not needed.
- In the guest, enable network discovery and file sharing if the folder is not visible.
- Refresh network view to locate VirtualBox server and the shared folder.
Snapshots
- Cold Snapshot: Taken when the VM is powered off; captures virtual disks and VM settings.
- Hot Snapshot: Taken while running; includes RAM and video RAM state.
- Creating a Cold Snapshot: Power off VM, open VirtualBox, take snapshot, name it, confirm.
- Creating a Hot Snapshot: With VM running, open Machine menu, take snapshot, name it, confirm.
- Hot snapshots take longer to complete than cold snapshots.
Networking Modes Summary
| Mode | Guest Internet Access | Guest-to-Guest Visibility | Host Access to Guest | External Access to Guest | Notes |
|---|
| NAT | Yes (via host) | No | No | No | Default and safe for general use |
| NAT Network | Yes (via host) | Yes (same NAT network) | No | No | Builds a local network of VMs |
| Bridged Adapter | Yes (direct) | Yes (entire LAN) | Yes | Yes | Security and IP consumption risks |
| Internal Network | No | Yes (same internal network) | No | No | Isolated from host and internet |
| Host-Only | No | Yes (same host-only network) | Yes | No | Good for host-guest interactions |
Key Terms & Definitions
- Virtual Machine: A software-emulated computer system running an operating system.
- VirtualBox: A virtualization platform used to create and manage virtual machines.
- NAT (Network Address Translation): Network mode where the VM accesses the internet through the host.
- Guest Additions: Drivers and tools enhancing integration between guest and host.
- Shared Folder: Host folder accessible from the guest as a networked location.
- Snapshot: A saved state of the VM for quick restoration.
Action Items / Next Steps
- Install VirtualBox from the official source and verify installation.
- Download a legitimate OS image (e.g., Windows 11) from official resources.
- Import or create a VM, then boot and validate basic operation.
- Install Guest Additions and enable shared clipboard and drag and drop.
- Configure a shared folder and verify access from the guest.
- Select an appropriate network mode for your testing scenario.
- Create both cold and hot snapshots to practice restoration.