Portable-VirtualBox is a free and open source software tool that lets you run any operating system from a usb stick without separate installation.
Install Virtualbox Without Admin Privileges Accountant. So if it was made portable, you could run your favourite operating system anywhere. Now, seeing as John is so amazing at writing launchers, and he says he can't release the portable QEMU package or whatever he says he's created.
Installation instructions
Download and run Portable-VirtualBox_v5.1.22-Starter_v6.4.10-Win_all.exe.
Choose a folder to extract to.
Go to the folder and run Portable-VirtualBox.exe. You'll see a window like the one below:
If you have already downloaded the installer for VirtualBox from www.virtualbox.org click search and navigate to the file. If not, click 'Download The Installation Files of VirtualBox.' Portable-VirtualBox will show you the download's progress.
Once the installer is download, check the boxes that are appropriate and click OK. Portable-VirtualBox will extract the files it needs from the VirtualBox installer, and restart itself afterward if you select the last checkbox.
Optional configuration
Portable-VirtualBox makes default settings automatically. You can modify them by pressing CTRL-5 or opening the tray menu while Portable-VirtualBox is running. Either action will bring up the configuration GUI below. The Hokey-Settings tab is shown open in the image below:
Features
Splash screen to start and end
Configurable Home Directory
Launch the VirtualBox GUI or directly launch a VM
Configure the hotkeys for managing your virtual machine
Configure USB and network support
Choose language for GUI
Saves settings in editable *.ini-files
Can automatically check for VirtualBox updates
All absolute paths in the VirtualBox.xml are replaced automatically by relative paths
Checks to make sure VirtualBox files exist
Install files signature
All install files after launcher version 6.4.10 is digitally signed. Signer is “Open Source Developer, Runar Buvik”, certificate is issued by Certum Level III CA. This is temporarily disabled until a new certificate arrives in the mail.
Note
VirtualBox needs several kernel drivers installed and needs to start several services: if the drivers and services are not already installed you'll need administrator rights to run Portable-VirtualBox.
When Portable-VirtualBox starts, it checks to see if the drivers are installed. If they are not it will install them before running VirtualBox and will remove them afterward. Similarly, Portable-VirtualBox checks to see if the services are running. If not, it will start them and then stop them when it exits.
If you want to save space you can remove the language files for other languages than your own. That can save you nearly 10 MB. They are in the nls directory.
You can also delete the documentation saving nearly 5 MB. You will find it in the doc directory.
When the VM is running you must press the 'Host-Key' (initially configured as the right CTRL-Key) to be able to use the other Hotkeys since otherwise the VM will have the focus.
Network support
To download of Portable-VirtualBox
Unpack from Portable-VirtualBox
Start from Portable-VirtualBox
Attitudes open (Tray --> attitudes, CTRL+5) --> rider Network (Tab) --> VirtualBox with network support start --> memory (save)
Terminate from Portable-VirtualBox
Start from Portable-VirtualBox
Driver installation agree
Wait
Selection of a VM and the network map to host interfaces stop
None of the files that come from VirtualBox are modified or otherwise changed.
Portable-VirtualBox downloads the VirtualBox installer which contains all of the VirtualBox files and drivers. Portable-VirtualBox unpacks the files and stores them in subdirectories . Portable-Virtualbox can also compress them in order to save space.
Oracle’s free VirtualBox virtualization solution is intended for use on the desktop. Management of virtual machines is via a GUI that only works locally and cannot be used on the network. Although a command-line option is available, it offers very few of the comforts to which you’ve become accustomed. With the tools presented in this article, users can control VirtualBox VMs on the server remotely and conveniently.
Why VirtualBox?
VirtualBox offers a number of advantages compared with other virtualization solutions. For example, the program is available free for the major platforms (e.g., Windows, Linux, Mac OS X, and Solaris), and it supports a wide number of guest systems, including exotics such as DOS/WIN 3.1 and OS/2.
Installing VirtualBox is easy on any platform because it usually only involves running a setup program or installing a package on the system. VirtualBox does not place heavy demands on the hardware; it does not require Intel VTX/AMD-V or a special Linux kernel, although it still offers great performance, thanks to its own guest extensions. In the VirtualBox Remote Desktop Protocol (VRDP, Figure 1), VirtualBox also has a built-in graphical interface to all the virtual machines: an RDP client is sufficient to access the VMs on the network regardless of the guest operating system.
Figure 1: Thanks to VRDP support, you can access the virtual machine consoles in your browser with phpVirtualBox.
Free or Not Free?
Up to version 4.0 of VirtualBox, both a commercial and an open source edition (OSE) existed. The OSE often was available in the various Linux distro repositories, so users could easily install via their package repositories. As of version 4.0, Oracle has now merged these two versions in a binary, which you can download from the VirtualBox website. For Linux users, Oracle continues to provide repositories for various Linux distributions. The non-free components, such as support for USB 2.0 devices, the VRDP server, and PXE boot for Intel network cards, were outsourced into the Extension Pack. Non-free here means Oracle has not released the source code. The Extension Pack is still available free of charge.
Headless Servers
For operations on devices without a graphical user interface, VirtualBox can launch virtual machines in Headless Mode. VMs launched in this way automatically have VRDP support, so that network access to the system running on the virtual machine is possible with an RDP client.
I installed VirtualBox on an Ubuntu LTS 10.04.4 (Lucid Lynx) server, 64-bit version. The host needs to be running a 64-bit kernel to create 64-bit VMs. The quickest way to install is to add the VirtualBox package source to your sources.list file
and then add the GPG key to your keychain:
Now, update the package list and install the current 4.1 version of VirtualBox:
For VRDP support, you still need the matching Extension Pack for your VirtualBox version. To be on the safe side, you will want to enter
to check the version. Then download and install the Extension Pack. For my server, the procedure is shown in Listing 1. VirtualBox should now be running on your server.
A Walk Through VirtualBox
Because the Linux server doesn’t have a graphical user interface, controls are restricted to the command line. The focus here is the vboxmanage command; if you call it with the -h parameter set, you are treated to no fewer than 448 lines of commands and parameters. You just need a few of them to start creating, cloning, deleting, and modifying virtual machines. For more information, check out Chapter 8 of the VirtualBox online help.
Anyone who finds this process cumbersome can simply use a same-version VirtualBox installed on the desktop (independent of operating system) and point and click to create the VMs for the server. Of course, the configuration for, say, the network has to be adjusted to match the host later on, but you can then easily export the VM and its virtual hard disk in the main menu (File | Export Appliance) to create an .ova file. If you use the .ovf extension, the configuration file and virtual disk will be exported to their own files. Once the VM has been copied to the server, it can be imported again with the command:
To start the virtual machine on the server, type:
If you are not quite sure of the name or the UUID for the VM, you can retrieve this information with the
command.
VirtualBox GUI on the Network
You will not always want to manage VirtualBox on the server via the command line. Alternatively, you can use the graphical front end phpVirtualBox by Ian Moore, which offers browser-based controls. phpVirtualBox maps the VirtualBox GUI in detail with the help of Ajax in the browser (Figure 2).
Figure 2: phpVirtualBox with its Ajax interface precisely emulates the known functionality of the native GUI.
This means virtually no restrictions compared with operations as usual on the native GUI. However, phpVirtualBox is not designed for setting up a hosted service in which multiple users have different permissions for the different VMs: The administrator on phpVirtualBox always has full control of all the VMs on the host.
phpVirtualBox
To communicate with the VirtualBox host, phpVirtualBox uses the Oracle SOAP interface VBoxWebSrv. In combination with a locally installed Apache2 web server with PHP 5 support, you then have a complete setup. The VirtualBox host and Apache could, in principle, be installed on two separate physical machines using phpVirtualBox. However, because Oracle’s VBoxWebSrv does not provide any kind of encryption, communications – and thus transmission of the password – from the web server to the VirtualBox host would be unencrypted.
VirtualBox doesn’t globally map VMs to the system, but always to the user who created the VM. Therefore, you first need to create an appropriate user and a group. In this example, the user will be vbox and the group vboxusers.
On Ubuntu, the following commands set this up:
The virtual machines are created later in the /home/vbox/VM directory. Finally, assign the new user a password:
Before you configure phpVirtualBox, you first need to install the Apache server, PHP, and some more packages, then set up VBoxWebSrv. To do so, create a file named /etc/default/VirtualBox with the editor of your choice and enter the user vbox in that file:
Then, start VBoxWebSrv with the command
and type
to ensure that the service also starts automatically after a reboot. Next, install the packages required for running phpVirtualBox:
Now, change directory to /var/www and download the latest stable version from the phpVirtualBox project website be typing the following at the command line:
After unpacking with
you will find a new directory named phpvirtualbox-4.1-7 in /var/www. For simplicity’s sake, change the directory name to phpvirtualbox to avoid unnecessary typing later on.
Finally, you need to add the username and password to the configuration file for phpVirtualBox. Fortunately, the developer provides a suitable template that you simply copy:
Now add the following lines to the /var/www/phpvirtualbox/config.php file:
In your web browser, you can now surf to http://<Hostname>/phpvirtualbox to access phpVirtualBox. For the first login, the username is admin and the password admin. Next, in File | Global Settings | User, assign administrative rights to the user vbox and define a password for logging into the web interface (Figure 3).
Figure 3: Setting up user vbox.
It is a good idea to delete the admin user immediately – or at least change the password to something secure. In the phpVirtualBox web GUI, you can now fully control VirtualBox over the network, just as in the native client.
Although it is easy to work with phpVirtualBox, unfortunately the VirtualBox API does not support automatically starting and stopping VMs at system boot or shutdown time, so you must again delve into the toolbox to automate the VirtualBox host’s operations as much as possible.
VBoxTool for Automation
VBoxTool comprises a series of wrapper scripts for the VirtualBox CLI tool VBoxManage; for example, you can automatically start and stop individual or all virtual machines when the host is started or shut down (Figure 4).
Figure 4: VBoxTool simplifies the management of virtual machines on a VirtualBox host. With a single command, you can view the status of VMs and start, stop, or backup via rsync.
With VBoxTool, you can also retrieve information about the status of all or just the current virtual machines or handle bulk operations at the command line with a single command.
All it takes to start, stop, or switch all virtual machines to save mode at the same time, or to back up the VMs automatically with the help of rsync, are the following commands:
When running the backup command, VBoxTool also takes care of automatically switching the machine to secure mode and restarting after creating the image.
Installation
Installing VBoxTool is very easy: First, download the ZIP archive from the VBoxTool project page, then unzip the contents of the ZIP archive in your home directory on the server system:
Then, copy the main script to /usr/local/bin:
Now you need to make the script executable,
and make the init script executable,
which then needs to be enabled for the appropriate runlevels:
The VBoxTool configuration is based on just two files, For the first file, you need to create a directory in /etc:
With your editor of choice, now create a file named vboxtool.conf that only contains the username of the account on which VBoxTool runs. In this example, the user is vbox:
Optionally, you can specify a backup directory to which the virtual machines are automatically backed up. If you specify a backup directory, you can back up virtual machines over the network – for example, to a NAS or a share on a server. However, you must make sure the user also has the appropriate write permissions in the specified directory.
If you do not explicitly specify the backup folder, the backups are created in the respective folders of the VMs.
For VBoxTool to know which VMs it is responsible for from now on, you need to create another file:
In the file, enter a separate line for each of the virtual machines on your host, using the following format:
Notice that you are not allowed to put spaces before or after the comma . On my test server, /etc/vboxtool/machines.conf looks like this:
The machines listed here are now automatically started by VBoxTool when the host system boots and are stopped again at shutdown.
The configuration stage is done. From now on, the commands listed in Table 1 are available for you to control your virtual machines.
Conclusions
VirtualBox is a genuine alternative to the established, and usually much more complex, virtualization environments of VMware and other server-side virtualization specialists. Although VirtualBox is primarily intended for use on the desktop, the hypervisor can be managed in headless mode – that is, without a graphical user interface.
If you are ready for some creative configuration, you can compensate for the lack of network connectivity in the VirtualBox GUI by designing your solution around a pair of helpful open source tools: VBoxManage and phpVirtualBox.
Info
[1]Ubuntu Apache documentation
The Author
Thomas Zeller has focused on IT security and open source for 15 years. Zeller is also the author/co-author of the books OpenVPN kompakt and Mindmapping mit FreeMind (in German). In real life, Thomas Zeller is the managing director of a medium-sized IT system integration company.
Related content
Latest Virtualbox Release 4.1.0 Can Clone VMs
Building Virtual Images with BoxGrinder and VMBuilder
Creating a virtual machine manually is straightforward but too time consuming if you regularly need to set up many virtual machines. The BoxGrinder and VMBuilder programs let you automate this process.
Virtualization with KVM
KVM continues to gain popularity in the world of Linux – so much so, that it has become Red Hat and Ubuntu's preferred virtualization solution. In contrast to Xen, setting up KVM involves just a couple of steps, and the guest operating systems can run without special patches.
VirtualBox Zero-Day Vulnerability Published
Vagrant, Serf, Packer, and Consul create and manage development environments
Four open source tools – Vagrant, Serf, Packer, and Consul – facilitate a developer's work by each handling one specific task elegantly.
Please enable JavaScript to view the comments powered by Disqus.comments powered by