Convert .ova and import it on Proxmox KVM virtualization

Let’s start uploading the exported ova file to the proxmox server. Extract the OVA file:

tar -xvf *.ova

This should output a couple of files from the OVA container, it should include an OVF file, which is the VM Defenition file, and a VMDK file, which is the actual hard disk image. Again, this may take a while.

Convert the vmdk to a Proxmox compatible qcow2 file:

qemu-img convert -f vmdk myvirtual-disk1.vmdk  -O qcow2 qcowdisk.qcow2

We now need to get the image into a VM with some hardware so that we can begin to use it. This is where things get tricky – the OVF file is not compatible with Proxmox and needs to be manually understood. The principle here is we are going to use the Proxmox web GUI to create a VM and replace the empty disk image which is created with our recently converted qcow2 image.

You can use vi to open the OVF file and understand some of the basic settings which are required for the VM. Open the OVF file and look for the following XML tags:

  • OperatingSystemSection
  • VirtualHardwareSection
  • Network
  • StorageControllers

Continue reading “Convert .ova and import it on Proxmox KVM virtualization” »

Share

Phpvirtualbox fix on 5.1 using 5.0

I was able to get v5.0-5 working with vbox 5.1 by commenting out the version check line and replacing it with a static value in the endpoints/api.php file:

// $response['data']['responseData']['phpvboxver'] = @constant('PHPVBOX_VER');
 $response['data']['responseData']['phpvboxver'] = "5.1-0";

Src: https://sourceforge.net/p/phpvirtualbox/discussion/general/thread/565b7f31/

Share

Understanding Virtualbox network interfaces

To create and experiment with all kinds of networks without the risk (or taking the trouble) of creating an actual one. And here is where VirtualBox excels by providing several options for networking out of the box. VirtualBox installs an additional NIC (Network Interface Card) on your host computer to identify itself while communicating with the guest. By default the host gets an IP address of 192.168.56.1. You can change the network modes, IP and other network settings by right-clicking your virtual machine on the left and clicking Settings. These are the networking modes that work with VirtualBox guest computers:

NAT (Default)
Host-only Network (Most secure)
Bridged Network (Least secure)
Internal-Network (Betweeen guests only)
Not Attached (No connectivity, guest isolated)
NAT: By default, the networking mode for your virtual machine is NAT (Network Address Translation) mode. This works something like this: Continue reading “Understanding Virtualbox network interfaces” »

Share

Virtualbox Disk Reduce or Disk Compact

You have to do the following steps:

1. Run defrag in the guest (Windows only)

Nullify free space: With a Linux Guest run this:

sudo dd if=/dev/zero of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile

Or:

telinit 1
mount -o remount,ro /dev/sda1
zerofree -v /dev/sda1

Or

sudo apt-get install secure-delete
sfill -f -z -l -l -I -v /

Continue reading “Virtualbox Disk Reduce or Disk Compact” »

Share

VBoxHeadless Running Virtual Machines With VirtualBox On A Headless CentOS 6x Server

 

Preliminary Note
I have tested this on a CentOS 6.2 server (host system) with the IP address 192.168.0.100 where I’m logged in as a normal user (user name vbox in this example) instead of as root.
If you only have a root account, but no normal user account, create one as follows (user admin, group admin)…
# groupadd vbox
# useradd -d /home/vbox -m -g vbox -s /bin/bash vbox
… create a password for the new user…
# passwd admin
Share

Set date/time permanently on Virtualbox Guest

First you need to ssh to the server and be root and then do these step by step:

1. Set the date/time as following format

# date -s “2 OCT 2013 18:00:00″

2. Set the proper Timezone for your area-

# cd /etc
# ln -sf /usr/share/zoneinfo/EST localtime

3. Set it to the BIOS for permanent stamp-

# /sbin/hwclock –systohc

On Debian/Ubuntu sytem:

dpkg-reconfigure tzdata

BDST NTP Server:

bsti1.time.gov.bd
bsti2.time.gov.bd

Use tzdata on Centos System:

To use it first download the tzdata package from the repo.

$ sudo yum -y install tzdata
$ tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none – I want to specify the time zone using the Posix TZ format.
#?

Select a value and press the return key to proceed.

You will now be asked a country to select from the list provided.

Please select a country.
1) Aaland Islands 18) Greece 35) Norway
2) Albania 19) Guernsey 36) Poland
3) Andorra 20) Hungary 37) Portugal
4) Austria 21) Ireland 38) Romania
5) Belarus 22) Isle of Man 39) Russia
6) Belgium 23) Italy 40) San Marino
7) Bosnia & Herzegovina 24) Jersey 41) Serbia
8) Britain (UK) 25) Latvia 42) Slovakia
9) Bulgaria 26) Liechtenstein 43) Slovenia
10) Croatia 27) Lithuania 44) Spain
11) Czech Republic 28) Luxembourg 45) Sweden
12) Denmark 29) Macedonia 46) Switzerland
13) Estonia 30) Malta 47) Turkey
14) Finland 31) Moldova 48) Ukraine
15) France 32) Monaco 49) Vatican City
16) Germany 33) Montenegro
17) Gibraltar 34) Netherlands

Select and confirm the selection with 1 for Yes.

This completes the setup but to make it permanent you should add the following line to your ~/.bashrc file.

TZ=’Europe/London’; export TZ

Then log out and back in again.

The user can now log in and run the date command

$ date

Fri Jul 19 14:56:53 BST 20

Share

VBoxHeadless Running Virtual Machines With VirtualBox On A Headless Debian/ubuntu Server

I have implemented this on Debian 6 (Squeeze system) with the IP address 192.168.0.100 where I’m logged in as root.

Installing VirtualBox To install VirtualBox 4.1 on our Debian server, we open /etc/apt/sources.list… added this line-

deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free

Use appropriate OS source list from https://www.virtualbox.org/wiki/Linux_Downloads

Then we download the VirtualBox public key…

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

… and update our package database: sudo apt-get update

Afterwards, we install VirtualBox 4.1 as follows:

apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.1 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.1.18 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.1.18/Oracle_VM_VirtualBox_Extension_Pack-4.1.18-78361.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.18-78361.vbox-extpack

(Make sure you grab the latest version from the VirtualBox web site.) Restart the Server at this stage to update the kernel with virtualbox optimized. Installing phpvirtualbox First create a system user called vbox and add it to the vboxusers group:

useradd -m vbox -G vboxusers

Create a password for the vbox user:

passwd vbox

Create the file /etc/default/virtualbox and put the line

VBOXWEB_USER=vbox

in it (so that the VirtualBox SOAP API which is called vboxwebsrv runs as the user vbox): vi /etc/default/virtualbox VBOXWEB_USER=vbox Next create the system startup links for vboxwebsrv and start it:

update-rc.d vboxweb-service defaults
/etc/init.d/vboxweb-service start

Now, run the following command to check if virtualbox kernel modules are loaded or not.

sudo systemctl status vboxdrv

Or

sudo /etc/init.d/vboxdrv status

Sample output:

vboxdrv.service - VirtualBox Linux kernel module
Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2015-11-26 16:38:30 IST; 42s ago

Nov 26 16:38:29 server systemd[1]: Starting VirtualBox Linux kernel module...
Nov 26 16:38:30 server systemd[1]: Started VirtualBox Linux kernel module.
Nov 26 16:38:30 server vboxdrv.sh[15008]: Starting VirtualBox kernel modules....
Hint: Some lines were ellipsized, use -l to show in full.

If it, not loaded, run the following command to load them:

sudo /etc/init.d/vboxdrv setup

We need a web server with PHP support to serve phpvirtualbox – I’m using Apache2 here. Install Apache2 and PHP5 as follows:

apt-get install apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common apache2 apache2-doc apache2-suexec libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libapr1 php5-common php5-mysql php5-suhosin php-pear wget

for Ubuntu you may install Apache-PHP with folliwng packages-

apt-get -y install apache2 php5-mysqlnd php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5 libapache2-mod-php5

For Ubuntu 16 use the following packs:

apt-get install php libapache2-mod-php php-mcrypt php-mysql  php-xml php-soap

Restart Apache2:

/etc/init.d/apache2 restart

Now, start vboxweb-service, and make it to start automatically on every reboot.

sudo systemctl status vboxweb-service

Or

sudo /etc/init.d/vboxweb-service start

Sample output:

Starting VirtualBox web service ...done.

I want to serve phpvirtualbox from Apache’s default virtual host with the document root /var/www (I will install it in /var/www/phpvirtualbox) – if you have a different document root, you must adjust the following steps: cd /var/www wget http://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.1-7.zip Unzip phpvirtualbox and rename the phpvirtualbox-4.1-7 to phpvirtualbox for ease of use: unzip phpvirtualbox-4.1-7.zip mv phpvirtualbox-4.1-7 phpvirtualbox Next go to the /var/www/phpvirtualbox/ directory… cd /var/www/phpvirtualbox/ … and create the file config.php by copying it from config.php-example: cp config.php-example config.php Open config.php and fill in the password you created earlier for the vbox system user: vi config.php […] /* Username / Password for system user that runs VirtualBox */ var $username = ‘vbox’; var $password = ‘secret’; […] That’s it already – you can now open a browser and access phpvirtualbox as follows:

http://www.example.com/phpvirtualbox/

Optional Task

Removing & updating Virtualbox Extension Pack:

For example removing virtualbox extension pack 4.3 to 5.1 version, do the following things-

$ VBoxManage list extpacks
Extension Packs: 1
Pack no. 0: Oracle VM VirtualBox Extension Pack
Version: 4.1.12
Revision: 77218
Edition:
Description: USB 2.0 Host Controller, VirtualBox RDP, PXE ROM with E1000 support.
VRDE Module: VBoxVRDP
Usable: true
Why unusable:

How to remove an extension pack:

$ VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully uninstalled "Oracle VM VirtualBox Extension Pack".

Src:

http://www.howtoforge.com/managing-a-headless-virtualbox-installation-with-phpvirtualbox-ubuntu-12.04

http://www.howtoforge.com/vboxheadless-running-virtual-machines-with-virtualbox-4.1-on-a-headless-ubuntu-12.04-server https://www.virtualbox.org/wiki/Linux_Downloads

http://www.virtualbox.org/manual/ch08.html#vboxmanage-extpack 

Share

Virtual USB and VBoxusergroup Troubleshoot on Linux Host

I faced USB issues on both Virtualbox installation on both Debian and CentOS linux host. I really didn't notice the urgency of vboxusers group in running VBox in headless mode!

Anyway, following snippets of texts really did help me out solving my USB problems. All credits goes to the VBox manual documents. The manual page links are provided below for future refences- Continue reading “Virtual USB and VBoxusergroup Troubleshoot on Linux Host” »

Share

VBoxHeadless – Running Virtual Machines With VirtualBox 4.0 On A Headless CentOS 5.6 Server

This guide explains how you can run virtual machines with VirtualBox 4.0 on a headless CentOS 5.6 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!

 

1 Preliminary Note

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

If you only have a root account, but no normal user account, create one as follows (user admin, group admin)…

# groupadd admin
# useradd -d /home/admin -m -g admin -s /bin/bash admin

… create a password for the new user…

# passwd admin

… and log in as that user. Continue reading “VBoxHeadless – Running Virtual Machines With VirtualBox 4.0 On A Headless CentOS 5.6 Server” »

Share

Install Virtualbox Extension pack in command line

– Open a command prompt as Administrator : Right-click on “Accessories\Command Prompt” and choose : Run As Administrator.
– CD C:\Program Files\Oracle\VirtualBox
– Make sure the ExtensionPack is located in the same directory
– C:\Program Files\Oracle\VirtualBox>VBoxManage.exe extpack install Oracle_VM_Virt
ualBox_Extension_Pack-4.0.4-70112.vbox-extpack

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.4-70112.vbox-extpack
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Successfully installed “Oracle VM VirtualBox Extension Pack”.

Share