Notes On Virtualization Tool -- Sun VirtualBox

Notes On Open Source Virtualization Tool -- Sun VirtualBox

VirtualBox is Sun's general-purpose full Virtualization Tool for All Major Operating Systems. It is of professional-quality, it is free and Open Source. It is great, easy to use with excellent UI, and absolutely worth trying.

We can download virtualbox from http://www.virtualbox.org/. Just install it, and learn from its well-documented User manual. Then we can create a new virtual machine, or reuse exsiting Microsoft's VHD or VMware's VMDK format image.


VirtualBox supports Disk image files (VDI, VMDK, VHD)

Normally, VirtualBox uses its own container format for guest hard disks – Virtual

Disk Image (VDI) files. In particular, this format will be used when you create a

new virtual machine with a new disk.

VirtualBox also fully supports the popular and open VMDK container format that

is used by many other virtualization products, in particular, by VMware.

Finally, VirtualBox also fully supports the VHD format used by Microsoft.

And we can aslo install VirtualBox Guest Additions which will make our life much easier by providing closer integration between host and guest and improving the interactive performance of guest systems.


The ways to Shutdwon VirtualBox

When you click on the "Close" button of virtual machine window, VirtualBox asks you whether you want to "save" or "power off" the VM.

There are three options:

Save the machine state:

VirtualBox would "freeze" the virtual machine by completely saving its state to local disk.

Send the shutdown signal:

This will send an ACPI shutdown signal to the virtual machine, which has the same effect as if you had pressed the power button on a real computer.

Power off the machine:

This is equivalent of pulling the power plug on a real computer without shutting it down properly. It may crash your VM.


The Guest Additions offer the following features

  • Better Mouse pointer integration.

  • Better video support.

  • Time synchronization.

  • Shared folders.

  • Seamless windows.

  • Shared clipboard.

  • Automated Windows logons.


Installing the Linux(Ubuntu) Guest Additions

Installation involves the following steps:

1. Before installing the Guest Additions, we will have to prepare our guest system for building external kernel modules. as with Linux hosts, we recommend using DKMS for Linux guests as well. If it is not installed, use this command:

sudo apt-get install dkms

2. Click Device > 'Install Guest Additions' to mount the VBoxGuestAdditions.iso file as Linux guest’s virtual CDROM drive.

3. Change to the directory where your CD-ROM drive is mounted and execute as root:

sh ./VBoxLinuxAdditions-x86.run

In a 64-bit Linux guest, use VBoxLinuxAdditions-amd64.run instead.


Problem

I am unable to install Ubuntu Guest Additions.

On http://forums.virtualbox.org/viewtopic.php?p=47963&sid=13ba1acf874ebeeef604e052e931e92e, I found the solution:

I'm unable to install virtualbox guest additions for Ubuntu 8.10 because: Kernel configuration is invalid. I think the guest addition installer cannot find linux kernel headers.

So I execute commands like:

sudo apt-get install linux-headers-2.6.27-7- ...


Virtual networking

Networking adapters can be separately configured to operate in one of the following four modes:

Not attached

Network Address Translation (NAT)

Host Interface Networking

Internal Networking


Shared folder between host and guest

Example: Shared Folders between XP host and Ubuntu guest

1. Add one folder to the shared folders properties of the Ubuntu VM.

we can do this via VirtualBox's GUI(please see http://servervirtualization.blogs.techtarget.com/2008/07/23/sun-xvm-virtualbox-easily-enables-folder-sharing/ )

or via command:

VBoxManage sharedfolder add "Ubuntu8.10-virtualbox" -name "shared2vb" -hostpath "D:\shared2vb"

2.Mount the shared folder to Ubuntu

2.1: For ubuntu, we have to first create the mount point folder:

sudo mkdir /media/shared2vb

otherwise, when we try to mount shared folder, we will get error like the following:

/sbin/mount.vboxsf: mounting failed with the error: No such file or directory

2.2: sudo mount -t vboxsf shared2vb /media/shared2vb


Alternative front-ends and remote virtual machines

VirtualBox has a very flexible internal design that allows you to use different front-ends to control the same virtual machines. To illustrate, you can, for example, start a virtual machine with VirtualBox’s easy-to-use graphical user interface and then stop it from the command line. With VirtualBox’s support for the Remote Desktop Protocol (VRDP), you can even run virtual machines remotely on a headless server and have all the graphical output

redirected over the network.

Main graphical user interface: VirtualBox

Command-line interface: VBoxManage

VBoxSDL is an alternative, simple graphical front-end with an intentionally limited feature set, designed to only display virtual machines that are controlled in detail with VBoxManage.

VBoxHeadless is yet another front-end that produces no visible output on the host at all, but merely acts as a VRDP server


Using VBoxManage to control virtual machines

VBoxManage list

The list command gives relevant information about your system and information about VirtualBox’s current settings.

VBoxManage list vms | runningvms

VBoxManage showvminfo

The showvminfo command shows information about a particular virtual machine.

VBoxManage showvminfo "Ubuntu8.10-virtualbox"

VBoxManage registervm / unregistervm

The registervm command allows you to import a virtual machine definition in an XML file into VirtualBox.

The unregistervm command unregisters a virtual machine. If -delete is also specified then the XML definition file will be deleted.

VBoxManage createvm

This command creates a new XML virtual machine definition file. The -name <name> parameter is required and must specify the name of the machine.

VBoxManage createvm -name 'Ubuntu8.10'

VBoxManage modifyvm

This command changes the properties of a registered virtual machine.

VBoxManage modifyvm "Windows XP" -memory "512MB"

VBoxManage startvm

This command starts a virtual machine that is currently in the "Powered off" or "Saved" states. This is provided for backwards compatibility only.

VBoxManage startvm "Ubuntu8.10-virtualbox"


VBoxSDL, the simplified VM displayer

VBoxSDL -vm "Ubuntu8.10-virtualbox"


Remote virtual machines (VRDP support)

VirtualBox has a built-in server for the VirtualBox Remote Desktop Protocol (VRDP). This allows you to see the output of a virtual machine’s window remotely on any other computer and control the virtual machine from there, as if it was running on the remote machine


Troubleshooting

Collecting debugging information For problem determination, it is often important to collect debugging information which can be analyzed by VirtualBox support.

Every time VirtualBox starts up a VM, a log file is created containing some information

about the VM configuration and runtime events. The log file is called Vbox.log and resides in the VM log file folder. Typically this will be a directory like this:

$HOME/.VirtualBox/Machines/{machinename}/Logs


Resources:

VirtualBox's User Manual(http://dlc-cdn-rd.sun.com/c1/virtualbox/2.1.0/UserManual.pdf)

http://servervirtualization.blogs.techtarget.com/2008/07/23/sun-xvm-virtualbox-easily-enables-folder-sharing/

http://vmetc.com/2008/08/06/virtualbox-shared-folders-protocol-error-in-ubuntu-guest/


Post a Comment

Labels

Java (159) Lucene-Solr (110) All (60) Interview (59) J2SE (53) Algorithm (37) Eclipse (35) Soft Skills (35) Code Example (31) Linux (26) JavaScript (23) Spring (22) Windows (22) Web Development (20) Tools (19) Nutch2 (18) Bugs (17) Debug (15) Defects (14) Text Mining (14) J2EE (13) Network (13) PowerShell (11) Chrome (9) Continuous Integration (9) How to (9) Learning code (9) Performance (9) UIMA (9) html (9) Design (8) Dynamic Languages (8) Http Client (8) Maven (8) Security (8) Trouble Shooting (8) bat (8) blogger (8) Big Data (7) Google (7) Guava (7) JSON (7) Problem Solving (7) ANT (6) Coding Skills (6) Database (6) Scala (6) Shell (6) css (6) Algorithm Series (5) Cache (5) IDE (5) Lesson Learned (5) Miscs (5) Programmer Skills (5) System Design (5) Tips (5) adsense (5) xml (5) AIX (4) Code Quality (4) GAE (4) Git (4) Good Programming Practices (4) Jackson (4) Memory Usage (4) OpenNLP (4) Project Managment (4) Python (4) Spark (4) Testing (4) ads (4) regular-expression (4) Android (3) Apache Spark (3) Become a Better You (3) Concurrency (3) Eclipse RCP (3) English (3) Firefox (3) Happy Hacking (3) IBM (3) J2SE Knowledge Series (3) JAX-RS (3) Jetty (3) Restful Web Service (3) Script (3) regex (3) seo (3) .Net (2) Android Studio (2) Apache (2) Apache Procrun (2) Architecture (2) Batch (2) Build (2) Building Scalable Web Sites (2) C# (2) C/C++ (2) CSV (2) Career (2) Cassandra (2) Distributed (2) Fiddler (2) Google Drive (2) Gson (2) Html Parser (2) Http (2) Image Tools (2) JQuery (2) Jersey (2) LDAP (2) Life (2) Logging (2) Software Issues (2) Storage (2) Text Search (2) xml parser (2) AOP (1) Application Design (1) AspectJ (1) Bit Operation (1) Chrome DevTools (1) Cloud (1) Codility (1) Data Mining (1) Data Structure (1) ExceptionUtils (1) Exif (1) Feature Request (1) FindBugs (1) Greasemonkey (1) HTML5 (1) Httpd (1) I18N (1) IBM Java Thread Dump Analyzer (1) JDK Source Code (1) JDK8 (1) JMX (1) Lazy Developer (1) Mac (1) Machine Learning (1) Mobile (1) My Plan for 2010 (1) Netbeans (1) Notes (1) Operating System (1) Perl (1) Problems (1) Product Architecture (1) Programming Life (1) Quality (1) Redhat (1) Redis (1) Review (1) RxJava (1) Solutions logs (1) Team Management (1) Thread Dump Analyzer (1) Troubleshooting (1) Visualization (1) boilerpipe (1) htm (1) ongoing (1) procrun (1) rss (1)

Popular Posts