Useful and lesser-known features of VirtualBox
Back to Square One
An alternative to Multiple Connect is the Shared type. This type works on the same principle, but VirtualBox creates a fresh differential image each time the virtual machine is restarted. The changes made by the virtual machine and all files created are lost each time the virtual machine is restarted. The Shared type can only be assigned to image files that do not grow dynamically.
If you are using snapshots and you do not want VirtualBox to store the disk image in the current snapshot, you can set the Type to Copy. If you set the Type to Immutable instead, VirtualBox enables write protection. But be careful: The guest system can still change the data of the hard disk image. However, when you restart the virtual machine, VirtualBox restores the image to its original state.
Data you previously thought you stored is then lost. In the background, VirtualBox uses differential images, which it deletes each time the virtual machine is restarted. The Immutable type is therefore only of interest in special cases, such as on publicly accessible computers or on PCs in training rooms, where you want to automatically restore the system to its original state after use.
If an error message appears when you change the type, the disk image is most likely still in use – or it belongs to a snapshot. In these cases, you first need to share the image or delete the snapshots.
Integrated Applications
You can also bring the windows running on a virtual machine to the desktop. VirtualBox calls this mode Seamless Mode, but it can only be enabled if you installed the Guest Additions on the virtual machine and are running Windows or a Linux system with X11 as a guest.
In this case, you need to press the Host key and L. VirtualBox then inflates the virtual machine to the screen size and hides the background of the guest system. To exit this mode, press Host+L again.
On My Command!
VirtualBox comes with the VBoxSDL command-line tool. VBoxSDL starts a virtual machine in a simple window. The VirtualBox developers only used the tool for internal tests of their own work, which is why they do not officially support it. However, it can be useful if you want to start the virtual machine from a script or if you don't want the virtual machine users to interfere with the configuration. To start a virtual machine, pass VBoxSDL the name of the virtual machine in the --startvm
parameter (Listing 1, line 1).
Listing 1
VirtualBox from the Command Line
As an alternative to the graphical user interface, the virtual machines can be managed with the VBoxManage command-line tool. Like VBoxSDL, VBoxManage offers the advantage that it is suitable for use in your own scripts. In addition, the tool gives you access to some functions that the VirtualBox Manager itself does not offer. To start a virtual machine with VBoxManage, pass the startvm
command and the name of the virtual machine to the tool (Listing 1, line 2).
Instead of the name, you can enter the unique identification number (UUID) of the virtual machine. The list
command (Listing 1, line 3) reveals which virtual machine has which UUID. Information about a virtual machine is returned by showvminfo
(line 4). The virtual machine can also be stopped (line 5), resumed (line 6), restarted (line 7), and turned off (line 8). The restart and shutdown actions correspond to pressing the reset button or unplugging the power plug. If you want to shut down the virtual machine in a controlled manner, send an appropriate ACPI command to the guest (line 9).
VBoxManage also provides the ability to create new virtual machines and customize the configuration of existing machines. The commands required for this don't just look complex and cumbersome, they are. If you don't have scripts to group them, you can put a new machine together far faster in the graphical user interface.
VBoxManage is happily faster when it comes to exporting (listing 1, line 10) and importing (line 11) a virtual machine and its settings to or from a hard disk image.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.