Showing posts with label Virtualbox. Show all posts
Showing posts with label Virtualbox. Show all posts

Thursday, May 26, 2011

VBoxHeadless - Running Virtual Machines With VirtualBox 4.0 On A Headless Ubuntu 11.04 Server

Version 1.0
Author: Falko Timme
Follow me on Twitter
Last edited 05/09/2011

This guide explains how you can run virtual machines with VirtualBox 4.0 on a headless Ubuntu 11.04 server. Normally you use the VirtualBox GUI to manage your virtual machines, but a server does not have a desktop environment. Fortunately, VirtualBox comes with a tool called VBoxHeadless that allows you to connect to the virtual machines over a remote desktop connection, so there's no need for the VirtualBox GUI.

I do not issue any guarantee that this will work for you!

I have tested this on an Ubuntu 11.04 server (host system) with the IP address 192.168.0.100 where I'm logged in as a normal user (user name administrator in this example) instead of as root.

To install VirtualBox 4.0 on our Ubuntu 11.04 server, we open /etc/apt/sources.list...

sudo vi /etc/apt/sources.list

... and add the following line to it:

[...]deb http://download.virtualbox.org/virtualbox/debian natty contrib

Then we download the VirtualBox public key...

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

... and update our package database:

sudo apt-get update

Afterwards, we install VirtualBox 4.0 as follows:

sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.0 dkms

(The dkms package ensures that the VirtualBox host kernel modules are properly updated if the Linux kernel version changes.)

Starting with version 4.0, VirtualBox has introduced so called "extension packs" and has outsourced some functionality like remote desktop connection support (VRDP) that was part of VirtualBox packages before version 4.0 into these extension packs. Because we need remote desktop connections to control our virtual machines, we need to install the appropriate extension pack now. Go to http://www.virtualbox.org/wiki/Downloads, and you will find a link to the following extension pack:

VirtualBox 4.0.6 Oracle VM VirtualBox Extension Pack
Support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards.

Download and install the extension pack as follows:

cd /tmp
wget http://download.virtualbox.org/virtualbox/4.0.6/Oracle_VM_VirtualBox_Extension_Pack-4.0.6-71344.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.6-71344.vbox-extpack

(Make sure you grab the latest version from the VirtualBox web site.)

(Make sure you run the last command with sudo - sudo VBoxManage extpack install ... - because otherwise you will get an error like this:

administrator@server1:/tmp$ VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.6-71344.vbox-extpack
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/tmp/Oracle_VM_VirtualBox_Extension_Pack-4.0.6-71344.vbox-extpack": The installer failed with exit code 127: Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address
administrator@server1:/tmp$

)

Now we must add the user that will run VirtualBox (administrator in this example) to the vboxusers group:

sudo adduser administrator vboxusers

VirtualBox is now installed and ready to be used.

To create a VM on the command line, we can use the VBoxManage command. See

VBoxManage --help

for a list of available switches and (highly recommended!) take a look at http://www.virtualbox.org/manual/ch08.html.

I will now create an Ubuntu 11.04 Server VM with 512MB memory and a 10GB hard drive from the Ubuntu 11.04 Server iso image (which I have stored in /home/ubuntu-11.04-server-amd64.iso):

VBoxManage createvm --name "Ubuntu 11.04 Server" --register
VBoxManage modifyvm "Ubuntu 11.04 Server" --memory 512 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
VBoxManage createhd --filename Ubuntu_11_04_Server.vdi --size 10000
VBoxManage storagectl "Ubuntu 11.04 Server" --name "IDE Controller" --add ide
VBoxManage storageattach "Ubuntu 11.04 Server" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium Ubuntu_11_04_Server.vdi
VBoxManage storageattach "Ubuntu 11.04 Server" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/ubuntu-11.04-server-amd64.iso

Let's assume you have a VM called examplevm that you want to reuse on this host. On the old host, you should have a directory Machines/examplevm in the VirtualBox directory; Machines/examplevm should contain the examplevm.xml file. Copy the examplevm directory (including the examplevm.xml file) to your new Machines directory (if your user name is administrator, this is /home/administrator/.VirtualBox/Machines - the result should be /home/administrator/.VirtualBox/Machines/examplevm/examplevm.xml).

In addition to that copy the examplevm.vdi file from the old VDI directory to the new one (e.g. /home/administrator/.VirtualBox/VDI/examplevm.vdi).

Afterwards, you must register the imported VM:

VBoxManage registervm Machines/examplevm/examplevm.xml

Regardless of if you create a new VM or import an old one, you can start it with the command:

VBoxHeadless --startvm "Ubuntu 11.04 Server"

(Replace Ubuntu 11.04 Server with the name of your VM.)

VBoxHeadless will start the VM and a VRDP (VirtualBox Remote Desktop Protocol) server which allows you to see the VM's output remotely on another machine.

To stop a VM, run

VBoxManage controlvm "Ubuntu 11.04 Server" poweroff

To pause a VM, run

VBoxManage controlvm "Ubuntu 11.04 Server" pause

To reset a VM, run

VBoxManage controlvm "Ubuntu 11.04 Server" reset

To learn more about VBoxHeadless, take a look at

VBoxHeadless --help

and at http://www.virtualbox.org/manual/ch07.html#vboxheadless.

VBoxHeadless - Running Virtual Machines With VirtualBox 4.0 On A Headless Ubuntu 11.04 Server - Page 2

Thursday, April 21, 2011

[Guide] How to Install FreeNAS 0.8 on VirtualBox 4

Install FreeNAS 0.8 on VirtualBox 4

FreeNAS is the best choice to create iSCSI disks and ZFS files systems in local PC with normal hard disk by using virtual machine or physical computer. Sysprobs already published several articles about FreeNAS on VMware and VirtualBox to configure and connect iSCSI disks, test VirtualBox teleportation and even Windows 2008 R2 Failover cluster. The latest 0.8  version is a complete revamped distribution with new features and interface. Version RC3 latest release as of today and this quick guide shows how to install FreeNAS 0.8 on VirtualBox 4.

I have used openfiler and FreeNAS for my virtual storage requirements, somehow I prefer FreeNAS  for easy installation, management and configuration. Recently I published a guide on installing FreeNAS 0.8 beta RC1 on VMware which did not bring any options to create disks or manage, I think that could be a bug in RC1.

Latest version is having all the options to create iSCSI disks, ZFS, edit networks and more. The improved features  in this version are;

A volume importer Better AFP and CIFS configuration Reworked and improved iSCSI support. Support for 6gbps 3Ware RAID controllers (and the command line utility tw_cli for managing them) HTTPS access for the GUI

1) Download the correct ISO from here.

For 32 Bit OS – Download the FreeNAS-8.0-RC3-i386.iso

For 64 Bit OS – Download the FreeNAS-8.0-RC3-amd64.iso

2) Create a new virtual machine in Oracle VirtualBox,

Install FreeNAS 0.8 on VirtualBox 4

Select Operating System as – BSD and Version is – FreeBSD

3) Allocate memory size ( Minimum 256MB, recommended 512MB) and create a new hard disk. I suggest to create a small hard disk VDI file (2GB) to install OS only, then add few hard disks for the storage purpose later.

summary of new vm

4) Now mount the downloaded FreeNAS 0.8 ISO file to CD Drive of virtual machine and start.

desktop virtualization software

5) With this version you can’t run from Live CD without installing to a disk like how we did in earlier 0.7 versions. Start it with default option in first screen.

desktop virtualization software

6) Select the hard disk you want to install OS and press OK.

storage virtualization

That’s it, installation should be completed smoothly. Remove the ISO file and restart the FreeNAS virtual machine.

7) Make sure VirtualBox virtual machine’s network configured properly ( NAT, Bridged or Host-only) to communicate with other virtual or physical computers. Then configure the IP address for FreeNAS OS by option 1 in Console Setup screen. Follow the each steps and give a static IP for virtual machine.

Install FreeNAS 0.8 on VirtualBox 4

Normally if you added one network adapter only, then em0 will be the interface. Give a name for the interface, I have given ‘lan1’ in this example. Type your IP address with subnet mask class, I used second example and mine was 10.10.27.41/24 (Class C network 255.255.255.0).

Now, FreeNAS 0.8 is ready to connect via web browser, make sure your client PC can ping to virtual machine’s new IP.

8.) Open the internet browser and type http://10.10.27.41, User name is ‘admin’ and password is ‘freenas’. This will bring the main page of FreeNAS 0.8 which is totally different from earlier version FreeNAS 0.7.

storage virtualization

9) Here is the working FreeNAS 0.8 RC3 inside Oracle VirtualBox as a virtual machine.

Install FreeNAS 0.8 on VirtualBox 4

Its having really cool and modified features compare to earlier versions. Creating iSCSI disks in FreeNAS 0.8 with VirtualBox and VMware will be interested and useful for learning purpose.  You can expect some more tutorials on this topic in future.

Stay tuned.

Wednesday, April 20, 2011

Hackintosh 10.6.7 – Snow Leopard on VirtualBox 4 with Working Sound

Snow Leopard on VirtualBox 4

We have published several guides on installing Mac OS X in normal PC with desktop virtualization software. You can find out all guides related to this topic here. Each guide is having several issues and drawbacks. Therefore I decided to publish another revamped complete guide on hackintosh 10.6.7 Snow Leopard on VirtualBox 4 with working sound.

Before continue the installation steps, let me summarize important issues fixed in this guide.

This works with original (vanilla kernel) retail DVD or ISO file. No need to download any hacked OS X distributions.Third party boot loaders are not required to load the original Snow Leopard DVD or ISO file.Shutdown and Restart of Virtual machine works without crashing.‘About the Mac’ option works without crashing and properly reading processor and memory (Intel Core2duo is in my case)Can be updated to latest 10.6.7.USB keyboard and mouse issue fixed after 10.6.7 update.USB storage (Flash disk or external hard disk) access crashing issue fixed.Sound is working inside Virtual machine, Bravoo…… Smile5 Screen resolution sizes can be adjustedShared folders between Mac OS X guest and Windows host for data sharing

1) Snow Leopard retail DVD – More information available on how to Rip the DVD to ISO format if you face any issues.

2) Hardware Virtualization Technology (VT) Enabled Computer in BIOS – Read this guide how to enable Virtualization Technology (VT) in BIOS and Confirm.

3) Latest VirtualBox and Its extension pack, as of today VirtualBox 4.0.4 is the latest. Read more here about extension pack installation and download

4) Bit patient Winking smile to read this full guide and other several guides I point out.

Intel Core2Duo 2.66GHz, 3GB RAM, Intel P35 chipset with Windows 7 32Bit Host OS.

Since I don’t have other processor computers, I can’t guarantee this guide for all types of processors, but I’m sure this will work on most of the Intel processor computers, AMD users must be lucky with this method, but it’s possible too.

1) Create a new virtual machine with Operating System type – Mac OS X and Version Mac OS X Server.

2) Configure RAM size (Minimum 1GB, Recommended 2GB) and Create new hard disk (20GB will be enough, but you can assign more).

3) Go to the newly created virtual machine’s settings and adjust the System settings as shown below.

Snow Leopard on VirtualBox 4

The things you must check here,

Floppy drive removed.Chipset selected to ‘ICH9’ (New chipset supported from VirtualBox 4 versions)Enable IO APIC, Enable EFI (This is the built in Boot loader for Mac OS X)

4) You can go to Display and adjust the maximum settings. To be honest, I don’t know how this will improve the video performance inside Mac VM, just hoping…..

Snow Leopard on VirtualBox 4

5) Go to storage option and mount the ISO file or select the host DVD drive here.

desktop virtualization software

If you want to install with Snow Leopard original retail DVD (Get it here) by inserting into host drive, select the Host drive option and make sure Passthrough is enabled as shown below.

Snow Leopard on VirtualBox 4

6) Go to USB options and make sure ‘Enable USB Controller’ and ‘Enable USB 2.0 (EHCI) Controller’ selected.

Check the sound option and confirm ‘Windows DirectSound’ and ‘Intel HD Audio’ options are selected. Intel HD Audio is the new virtual audio controller added with VirtualBox 4 and later versions, this driver works inside Snow Leopard virtual machine.

7) Check the installed VirtualBox extension pack on host computer. Extension pack should be installed to support USB2.0 in Snow Leopard VM, if not you will get crashing screen while trying to access USB storage.

Here is the guide about USB crashing problem

Check this guide how to install VirtualBox VM Extension Package

oracle virtualbox extension pack

8.) Now go to virtual machine’s folder ( C:\Users\User-Name\VirtualBox VMs\Virtual-Machine-Name) and open the .vbox file in word processing software like MS WordPad.

Snow Leopard on VirtualBox 4

9) Enter the following string in the location mentioned in example file.

Here is the example file of working Snow Leopard in VirtualBox 4.

extra_xml_thumb1

The above extra string helps in several ways to install Snow Leopard in VirtualBox 4.

Original Vanilla kernel installation with original retail DVDVirtualBox built in EFI boot loader works here. So, you do not need any third party boot loaders.Shutdown and restart of VM works (no hanging screen)‘About the Mac’ screen works inside snow leopard virtual machine.

10) Power on the virtual machine now. Installation must start normally without any issues. Follow more installation steps and how to create partition during the installation in this guide.

Complete the initial setups and configurations. I’m sure you will land on working Snow Leopard desktop in VirtualBox 4.

1) Network, USB Access inside virtual machine

NAT and Bridged networking modes worked straightaway inside virtual machine.

USB storage access such as Flash disk and external hard disk worked fine without any issues.

Important Note – You must install VirtualBox Extension Pack before access USB

2) Sound

That’s a really great news for hackintosh users in Oracle VirtualBox. New VirtualBox 4 and latest versions’ new motherboard and sound chipset support sound in Snow Leopard. I can hear 90% clear and unbreakable sound from VM.

working sound in Snow leopard on Virtualbox 4

Double check the main chipset type under System was set to ICH9 and Audio Controller set to Intel HD Audio as shown above. I’m not sure how this will work in AMD based computers.

working sound

3) Screen Resolution Sizes

Since we do not have proper VirtualBox guest additions tools for Mac OS X, we have to use manual methods to modify screen resolution size to 5 options.

Check the below guide and user comments to find out the correct working method for you.

Increase Mac OS X Snow Leopard Screen Resolution Size in VirtualBox

4) Latest 10.6.7 Update

It worked fine. Because of this is purely running from original vanilla kernel without any hacked versions, the update (software or manual) to 10.6.7 installed well.

Just check this guide where to download combo and separate Snow Leopard 10.6.7 update and run the installation.

Take a snapshot before run the update.

hackintosh 10.6.7 on VirtualBox

5) Shared Folders in Snow Leopard Virtual machine and Windows 7 host

Though, VirtualBox shared folders can’t be used here without guest additions tools, we can use normal file sharing between Mac OS X and Windows by setting up network. You can share large amount of data by this step.

More information available here to setup shared folders in Mac OS X and Windows 7

I hope this guide will be useful in running latest Hackintosh 10.6.7 Mac OS X Snow Leopard on VirtualBox 4 for testing and learning purposes.

You can’t expect the all full features as running on physical Apple hardware, but still its useful for experiment purpose with your normal PC.

You can download free eBook from Sysprobs for more useful installation methods, tips and tricks on Hackintosh on desktop virtualization software VMware and VirtualBox.

Feel free to drop some comments, success and failure installation attempts, I will be happy to help you.

Have fun.

Update Snow Leopard by Hazard to 10.6.7 on VMware or VirtualBox

Snow Leopard 10.6.2 Intel AMD by Hazard is a famous hackintosh distribution available on internet. It was almost tweaked for Intel and AMD physical computers with most of the famous chipsets. The good thing is, it works well on Oracle VirtualBox without any third party boot loaders or editing configuration files. But the main issue is, this can’t be updated to latest Mac OS X versions because of its running in hacked kernel which can’t be upgraded. This guide is showing how to update Snow Leopard 10.6.2 Intel AMD by Hazard  to 10.6.7 latest update on VMware or VirtualBox.

10.6.7 hazard on virtualboxI’m not only showing the way of update, but also the few and important points you must consider to install Snow Leopard 10.6.7 Intel AMD by Hazard on VirtualBox and VMware.

1) The latest Oracle VirtualBox 4 came with new motherboard and sound virtual chipsets. Therefore it makes the possibility of working sound inside Snow Leopard virtual machine.

Make sure the following chipsets are set for virtual machine before start the hazard installation.

main chipsetsound chipset

2) Install the latest VirtualBox VM Extension pack corresponding to your version. As of today 4.0.4 is the latest release and read more here where to download VirtualBox extension pack 4.0.4 and install.

This step must be done to avoid virtual machine crashing problem while accessing USB storage devices inside Snow Leopard VM.

3) Check this guide to install Snow Leopard 10.6.2 Intel AMD by Hazard on VirtualBox.

4) Skip the next part and go to last part to update.

1) By any chance you are running Snow Leopard 10.6.2 Intel AMD by Hazard  on VMware workstation or VMPlayer, make sure to replace some kext files before restart the virtual machine after the software update.

If you restart the Snow leopard virtual machine without replacing these kext files with older version, then your USB keyword,mouse and storage will stop working.

Check this guide to replace kext files and  fix USB issues after latest Mac OS X update in VMware.

2) Follow the next part.

It’s the same procedure in VirtualBox and VMware.

The important thing is, we must install the additional legacy kernel 10.6.7 package (which will overwrite the kernel) before press Restart button after the update.

1) Download and transfer the legacy kernel 10.6.7 to your Mac OS X virtual machine.

Snow Leopard legacy kernel 10.6.7

2) Now, either you run the software update or download the latest 10.6.7 combo update manually.

Start the update, if you have snapshot feature in your desktop virtualization software, then better take a snapshot of current state now.

Once installation (update) completed, DO NOT press restart button. It will allow you to work on other things without restarting or closing the dialog box.

3) Run the legacy kernel 10.7.0 package now.

Update Snow Leopard by Hazard to 10.6.7

4) Select legacy kernel option as shown below. I’m not sure how this update will work on AMD processor computer.

Please someone update the result in comments area.

select legacy 10.6.7 kernel

5) Once the kernel package installation completed, restart the Snow leopard virtual machine now.

You may get some VirtualBox errors while restarting. Do not worry, just power off the virtual machine and power it on again.

I’m sure it will boot properly with all latest updated Mac OS X 10.6.7.

Here is the updated Snow Leopard 10.6.7 Intel AMD by Hazard on Oracle VirtualBox with 95% working sound.

Update Snow Leopard by Hazard to 10.6.7

I’m sure these steps can be done easily by you, since this Hazard is already tweaked for non apple hardware.

Just let me know how it worked for you.

Have fun

Thursday, February 17, 2011

Virtualbox Walkthrough: Ubuntu 10.04

This walkthrough takes you through creating a virtual machine on Virtualbox and installing Ubuntu 10.04 on it. This is a fairly thorough walkthrough, but by no means complete. When in doubt, consult the manual. It is assumed that you know the details of how to install Virtualbox, and Ubuntu as well. While neither of these are very difficult, both procedures exceed the scope of this text.


The host machine and OS is a Thinkpad T410 and Windows 7 64bit, respectively. The T410 (lovingly dubbed “Athena”) has an Intel Core i5-520M processor running at 2.40Ghz, integrated graphics and 4GB of RAM. However, these instructions should work on any machine capable of running Ubuntu and its host OS simultaneously. The version of Virtualbox used was the latest at the time–3.2.6.


When you open Virtualbox, you should see something like this:



From the default window, press the “New” button and the virtual machine wizard will load. The first window asks you to name your new virtual machine and which OS you will install on it.



N.B. You will see the “64 bit” option in OS type for Ubuntu. Use that ONLY if you are running a 32 bit host and you wish to emulate 64 bit:



If you want to use 64-bit guest support on a 32-bit host operating system, you must also select a 64-bit operating system for the particular VM. Since supporting 64 bits on 32-bit hosts incurs additional overhead, VirtualBox only enables this support upon explicit request.


On 64-bit hosts, 64-bit guest support is always enabled, so you can simply install a 64-bit operating system in the guest. (Source)


Clicking “Next” brings you to a slider that allows you to set how much RAM you wish to allot to your VM–how much RAM the emulated system will see. Don’t go past the green section or you risk freezing your host. I put 1.5GB, as Ubuntu runs fine with that much.



Next is configuring the virtual hard drive.



If you haven’t already created a hard disk, the wizard will walk you through that too. The virtual disk wizard has preset options that work fine. If you’re curious as what the differences between options are and don’t understand the brief description provide in the wizard, go read the manual.



Once you have configured your virtual disk, you should be led to this summary:



After hitting finish, you should see your new VM on the left. Select it and click “Start”.



When a VM in virtual box runs for the first time, the first run wizard pops up and asks you to load installation media. I’ve chosen an ISO image of Ubuntu 10.04 64bit. You can either use an ISO (easily downloadable from the ubuntu homepage), or a physical Ubuntu CD or DVD.



Ubuntu ISO booting:



Note: there are various alerts that will pop up that you should read at least once.


Now that the ISO is finished booting, you will be given the option to either try or install Ubuntu. You should know where to go from here.



Treat the virtual hard drive that Ubuntu detects normally. Partition however you are used to.



Installation takes a while. Go grab food or something.



Once the installation is complete, restart as prompted and you will boot into your new virtual Ubuntu installation!



Notice the low resolution. This is an indicator that Ubuntu doesn’t realize that it’s being run in a virtual environment. In order to fix this, Virtualbox has a patch called Guest Additions. But before that, update the system.



The first update generally takes the longest (unless you have an uber-fast connection). I got through a chapter of Hitchhiker’s Guide to the Galaxy and half a podcast of a college lecture before the system was fully updated. Ubuntu will probably ask for a restart so that it can load the updated kernel. Do so.


Once the desktop comes back up, go to Devices > Install Guest Additions. That will load an ISO into the VM’s CD drive. Ubuntu will detect it automagically and will want to auto-run it. I ignored that and opened a terminal and did the following:



This will install Guest Additions in Ubuntu.



After that’s done, it will ask to restart yet again. After boot you should notice a refreshingly better resolution:



Since it’s a virtual machine, I turned off the screensaver and power options, and enabled auto login.


Lastly, for whatever reason, Virtualbox crashes when desktop effects are enabled. This also occurs when I attempt to shutdown/restart/logout/etc with desktop effects enabled. So beware of that. YMMV. Cheers.


 

Wednesday, September 15, 2010

Virtualbox Walkthrough: Ubuntu 10.04

This walkthrough takes you through creating a virtual machine on Virtualbox and installing Ubuntu 10.04 on it. This is a fairly thorough walkthrough, but by no means complete. When in doubt, consult the manual. It is assumed that you know the details of how to install Virtualbox, and Ubuntu as well. While neither of these are very difficult, both procedures exceed the scope of this text.

The host machine and OS is a Thinkpad T410 and Windows 7 64bit, respectively. The T410 (lovingly dubbed “Athena”) has an Intel Core i5-520M processor running at 2.40Ghz, integrated graphics and 4GB of RAM. However, these instructions should work on any machine capable of running Ubuntu and its host OS simultaneously. The version of Virtualbox used was the latest at the time–3.2.6.

When you open Virtualbox, you should see something like this: