• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Run VirtualBox on Ubuntu 14.04 Cloud Server Instance

By Abhishek Ghosh January 2, 2015 9:29 am Updated on January 2, 2015

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance

Advertisement

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance – Yeah, Virtualization within Virtualization! It is actually possible to install and run. When we run virtual machines with VirtualBox on computer, normally we use the VirtualBox GUI to manage the virtual machines – like we shown in the guide to run Ubuntu on MacBook Pro. but a server does not have a desktop environment unless we specifically prepare it for using as VNC. VNC setup is not required to run VirtualBox on Ubuntu 14.04 Cloud Server Instance. VirtualBox has a tool called VBoxHeadless that basically allows you to connect to the virtual machines over a remote desktop connection, so the GUI is not required.

 

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance : Initial Steps

 

You can open an account on DigitalOcean using this link, if you have a Credit Card and no Account on DigitalOcean. You’ll get $10 account credit plus you can add any coupon (if applicable) to increase your account’s credit. Enough to test our guides free of cost.

We are taking that you are using either DigitalOcean or Rackspace Cloud or HP Cloud to test. For HP Cloud, you need to set Ingress-Egress policy. HP Cloud is a bit hard and great to learn networking and OpenStack.

Advertisement

---

Spin a 4GB instance with Ubuntu 14.04 LTS image. First SSH to the instance :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
ssh root@IP-Address
##The authenticity of host '127.0.0.1' can't be established.
##ECDSA key fingerprint is
################
##Are you sure you want to continue connecting (yes/no)?
# type yes and hit the return key
# you will have the password, use it and change it
# upgrade and update
apt-get update -y && apt-get upgrade
# do a dist-upgrade
apt-get diet-upgrade -y
# reboot and login again
ssh root@IP-Address

Ubuntu 14.04 is named trusty, open your /etc/apt/sources.list :

Vim
1
nano /etc/apt/sources.list

Add this line :

Vim
1
deb http://download.virtualbox.org/virtualbox/debian trusty contrib

Download the Public Key and update apt :

Vim
1
2
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
apt-get update -y

 

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance : Main Steps

 

Run this :

Vim
1
apt-get install dkms unzip linux-headers-$(uname -r) build-essential virtualbox-4.3 -y

That dkms is an important thing. Run this :

Vim
1
2
cd /opt
wget http://download.virtualbox.org/virtualbox/4.3.14/Oracle_VM_VirtualBox_Extension_Pack-4.3.14-95030.vbox-extpack

We got the link from here :

Vim
1
https://www.virtualbox.org/wiki/Downloads

Run this command with sudo :

Vim
1
sudo VBoxManage ext pack install Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack

You should create users other than root. Take that you have created a user named abhishek, then run this :

Vim
1
sudo adduser abhishek vboxusers

You can set password in this way :

Vim
1
sudo passwd vbox

VirtualBox is now installed and ready to be used. VBoxManage brings the interactive mode. Like running :

Vim
1
VBoxManage --help

will show you the commands.

 

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance : Optionally Adding a Web Interface

 

Adding a Web Interface to run VirtualBox on Ubuntu 14.04 Cloud Server is optional. We will run Apache2 web server and install the PHP components for it :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
apt-get install apache2 php5 libapache2-mod-php5 php-soap -y && service apache2 restart
cd /opt && rm -r
wget 'http://downloads.sourceforge.net/project/phpvirtualbox/phpvirtualbox-4.3-1.zip' -O phpvirtualbox.zip
unzip phpvirtualbox.zip
mv phpvirtualbox-4.3-1 /var/www/html/phpvirtualbox
mv /var/www/html/phpvirtualbox/config.php-example /var/www/html/phpvirtualbox/config.php
nano /var/www/html/phpvirtualbox/config.php
# this are instructions  
# That $username and $password should match the user you created
nano /etc/default/virtualbox
# make sure you have this line :
# Add VBOXWEB_USER=vbox
sudo /etc/init.d/vboxweb-service start

In a browser, i you point go to http://your-IP/phpvirtualbox and login with username ‘admin’ and password ‘admin’. You should change it after login into phpvirtualbox.

These are optional steps.

 

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance : Managing Virtual Machines From SSH

 

If we do not use the Web Interface, we still can use VirtualBox to create instance, import and run ISO. All guides are written on :

Vim
1
2
http://www.virtualbox.org/manual/ch08.html
http://www.virtualbox.org/manual/ch07.html#vboxheadless

Another important part is VirtualBox networking setting, you need to select bridged rather than the default of NAT. By default, VirtualBox VMs will present the guest operating system with a networking setup that works well enough for a web browser.

Selecting this bridged networking makes the virtual machine to appear as if it is simply another computer attached to your network via an Ethernet cable. That is separate story though. This way, we found even easier than container based virtualization.

Run VirtualBox on Ubuntu 14.04 Cloud Server Instance

 

Run VirtualBox on Ubuntu 12.04 Cloud Server Instance : HP Cloud

 

Another way we found probably work on HP Cloud Only. Notice that, this is for Ubuntu 12.04.

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## Install necessary packages
apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## kvm unloaded
modprobe -r kvm_amd kvm_intel
service virtualbox stop
service virtualbox start
## cloud image of 12.04
img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img"
## cloud-localds is not in archive
localds_url="http://bazaar.launchpad.net/~cloud-utils-dev/cloud-utils/trunk/download/head:/cloudlocalds-20120823015036-zkgo0cswqhhvener-1/cloud-localds"
which cloud-localds ||
  { sudo wget "$localds_url" -O /usr/local/bin/cloud-localds &&
    sudo chmod 755 /usr/local/bin/cloud-localds; }
## download a cloud image to run
img_dist="${img_url##*/}"
img_raw="${img_dist%.img}.raw"
my_disk1="my-disk1.vdi"
wget $img_url -O "$img_dist"
qemu-img convert -O raw "${img_dist}" "${img_raw}"
vboxmanage convertfromraw "$img_raw" "$my_disk1"
## create user-data
seed_iso="my-seed.iso"
cat > my-user-data <<EOF
##cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF
cloud-localds "$seed_iso" my-user-data
## create a virtual machine using vboxmanage
vmname="precise-nocloud-1"
vboxmanage createvm --name "$vmname" --register
vboxmanage modifyvm "$vmname" \
   --memory 512 --boot1 disk --acpi on \
   --nic1 nat --natpf1 "guestssh,tcp,,2222,,22"
# Another option for networking
--nic1 bridged --bridgeadapter1 eth0
vboxmanage storagectl "$vmname" --name "IDE_0"  --add ide
vboxmanage storageattach "$vmname" \
    --storagectl "IDE_0" --port 0 --device 0 \
    --type hdd --medium "$my_disk1"
vboxmanage storageattach "$vmname" \
    --storagectl "IDE_0" --port 1 --device 0 \
    --type dvddrive --medium "$seed_iso"
vboxmanage modifyvm "$vmname" \
--uart1 0x3F8 4 --uartmode1 server my.ttyS0
## start VM
vboxheadless --vnc --startvm "$vmname"
## connect to the vnc port that vboxheadless
## showed was used.  The default would be '5900', after the system boots, you can ssh in with 'ubuntu:passw0rd'
## via 'ssh -p 2222 ubuntu@localhost'
## To see where kernel output goes, you
## can use 'socat', like this:
socat UNIX:my.socket -
## poweroff
vboxmanage controlvm "$vmname" poweroff
## clean up
vboxmanage storageattach "$vmname" \
   --storagectl "IDE_0" --port 0 --device 0 --medium none
vboxmanage storageattach "$vmname" \
   --storagectl "IDE_0" --port 1 --device 0 --medium none
vboxmanage closemedium dvd "${seed_iso}"
vboxmanage closemedium disk "${my_disk1}"
vboxmanage unregistervm $vmname --delete

You should read the Ingress-Egress for HP Cloud.

Tagged With Ubuntu10 04下运行VirtualBox显示非致命性错误 , cloud computing virtualbox role , cloud sync virtualbox , how to install virtualbox on ubuntu instance? , oracle cloud ubuntu установка virtualbox , run virtual box from a cloud , run virtualbox in cloud , virtual box running on ubuntu server , virtualbox open cloud instance
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Run VirtualBox on Ubuntu 14.04 Cloud Server Instance

  • Install Elastic Stack on Ubuntu 16.04, CentOS 7 Single Cloud Server

    Here is How to Install Elastic Stack on Ubuntu 16.04, CentOS 7 on Single Cloud Server Instance For Server Log Analysis, Big Data Processing.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • Install WordPress on HP Cloud (Ubuntu, Nginx)

    Here is step by step guide to install WordPress on HP Cloud with one Database Server and one Web server on Ubuntu and Nginx PHP5-FPM platform.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy