This page (revision-40) was last changed on 23-Apr-2022 17:06 by Harry Metske

This page was created on 23-Apr-2022 17:05 by Harry Metske

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
40 23-Apr-2022 17:06 41 KB Harry Metske to previous
39 23-Apr-2022 17:05 41 KB Harry Metske to previous | to last
38 23-Apr-2022 17:05 40 KB Harry Metske to previous | to last --biosbootmenu disabled, not more than one cpu
37 23-Apr-2022 17:05 38 KB Harry Metske to previous | to last
36 23-Apr-2022 17:05 37 KB Harry Metske to previous | to last
35 23-Apr-2022 17:05 37 KB Harry Metske to previous | to last
34 23-Apr-2022 17:05 37 KB Harry Metske to previous | to last
33 23-Apr-2022 17:05 37 KB Harry Metske to previous | to last
32 23-Apr-2022 17:05 37 KB Harry Metske to previous | to last
31 23-Apr-2022 17:05 36 KB Harry Metske to previous | to last
30 23-Apr-2022 17:05 35 KB Harry Metske to previous | to last
29 23-Apr-2022 17:05 35 KB Harry Metske to previous | to last
28 23-Apr-2022 17:05 35 KB Harry Metske to previous | to last guest properties
27 23-Apr-2022 17:05 33 KB Harry Metske to previous | to last
26 23-Apr-2022 17:05 32 KB Harry Metske to previous | to last
25 23-Apr-2022 17:05 32 KB Harry Metske to previous | to last
24 23-Apr-2022 17:05 31 KB Harry Metske to previous | to last
23 23-Apr-2022 17:05 30 KB Harry Metske to previous | to last
22 23-Apr-2022 17:05 30 KB Harry Metske to previous | to last
21 23-Apr-2022 17:05 29 KB Harry Metske to previous | to last cpu affinity

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 8 added 2 lines
%%warning A new report on [VirtualBox-4.1] is also available %%
At line 474 changed one line
''mount -t vboxsf SharedFolderDefault /tmp/ff'' .
''mount -t vboxsf SharedFolderDefault /tmp/ff'' .\\
I could not get this to work, I keep getting
At line 484 added 30 lines
''vb guestproperty set ubuntu910 GUESTNAME ubuntu910 --flags RDONLYGUEST''
And then in the guest :
{{{
root@ubuntuminimal:/proc# VBoxControl guestproperty enumerate
VirtualBox Guest Additions Command Line Management Interface Version 3.0.10
(C) 2008 Sun Microsystems, Inc.
All rights reserved.
Name: /VirtualBox/HostGuest/SysprepExec, value: <NULL>, timestamp: 1257533847419218000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepArgs, value: <NULL>, timestamp: 1257533847419316000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/GuestInfo/OS/Product, value: Linux, timestamp: 1257533870949479000, flags: <NULL>
Name: /VirtualBox/GuestInfo/OS/Release, value: 2.6.31-14-generic, timestamp: 1257533870949929000, flags: <NULL>
Name: /VirtualBox/GuestInfo/OS/Version, value: #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009, timestamp: 1257533870950252000, flags: <NULL>
Name: /VirtualBox/GuestInfo/OS/ServicePack, value: <NULL>, timestamp: 1257533870950573000, flags: <NULL>
Name: /VirtualBox/GuestAdd/Version, value: 3.0.10, timestamp: 1257533870950879000, flags: <NULL>
Name: /VirtualBox/GuestAdd/Revision, value: 54097, timestamp: 1257533870951186000, flags: <NULL>
Name: /VirtualBox/GuestInfo/OS/LoggedInUsers, value: 1, timestamp: 1257535893474621000, flags: <NULL>
Name: /VirtualBox/GuestInfo/OS/NoLoggedInUsers, value: false, timestamp: 1257533900982916000, flags: <NULL>
Name: /VirtualBox/GuestInfo/Net/Count, value: 1, timestamp: 1257535893475150000, flags: <NULL>
Name: /VirtualBox/GuestInfo/Net/0/V4/IP, value: 10.0.0.177, timestamp: 1257535893475491000, flags: <NULL>
Name: /VirtualBox/GuestInfo/Net/0/V4/Broadcast, value: 10.0.0.255, timestamp: 1257535893476082000, flags: <NULL>
Name: /VirtualBox/GuestInfo/Net/0/V4/Netmask, value: 255.255.255.0, timestamp: 1257535893476291000, flags: <NULL>
Name: /VirtualBox/GuestInfo/Net/0/Status, value: Up, timestamp: 1257535893476635000, flags: <NULL>
Name: /VirtualBox/HostInfo/GUI/LanguageID, value: C, timestamp: 1257533747000847000, flags: <NULL>
Name: /VirtualBox/HostInfo/VBoxVer, value: 3.0.10, timestamp: 1257533847421017000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxRev, value: 54097, timestamp: 1257533847421081000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/GuestInfo/OS/LoggedInUsersList, value: metskem, timestamp: 1257535893474087000, flags: <NULL>
Name: GUESTNAME, value: ubuntu910_minimal, timestamp: 1257535894696852000, flags: <NULL>
}}}
At line 518 added 19 lines
!! Installation of guest additions
* scp file ''/usr/share/virtualbox/VBoxGuestAdditions.iso'' from the host to your guest
* login to guest and mount the iso ''mkdir /tmp/ff && sudo mount -o loop /tmp/VBoxGuestAdditions.iso /tmp/ff''
* ''apt-get install linux-headers-2.6.31-14 linux-headers-2.6.31-14-generic gcc''
* run it:
{{{
root@ubuntuminimal:/tmp/ff# ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 3.0.10 Guest Additions for Linux installation........................................................
VirtualBox 3.0.10 Guest Additions installation
Building the VirtualBox Guest Additions kernel module...
Building the shared folder support kernel module...
Building the drm support kernel module...
Installing the VirtualBox Guest Additions...
Could not find X.org or XFree86 on the guest system. The X Window drivers
will not be installed.
}}}
At line 553 changed one line
! Preparing original mother system
! Preparing mother system (DSL)
At line 563 changed one line
* __TODO__ to use this name in the guest, you first have to install the guest additions, see Chapter 4.3.1 ''Installing the Linux Guest Additions''
* to use this name in the guest, you first have to install the guest additions, see Chapter 4.3.1 ''Installing the Linux Guest Additions''
At line 628 added 17 lines
! Preparing mother system (Ubuntu)
The same thing was done with a rather minimal Ubuntu910 server.\\
To summarize :
* 1.5 GB filesystem
* set the hostname inside the guest to guestproperty GUESTNAME by adding the following to /etc/rc.local:
{{{
# set the hostname to the value that is set by the hypervisor
HostName=`VBoxControl guestproperty get GUESTNAME | grep Value | cut -d' ' -f2`
hostname $HostName
echo $HostName > /etc/hostname
logger "$0 : hostname set to $HostName"
}}}
* store my id_rsa.pub file in ~/.ssh
* visudo so that I can easily su without prompting
* removing /etc/udev/rules.d/70-persistent-net.rules (or you get eth1 in use instead of eth0 on the cloned guest)
At line 679 added 93 lines
Or the new script for Ubuntu:
%%prettify
{{{
#!/bin/sh
#
# script to generate VBoxManage VMs
#
NUMVMS=$1
for N in `seq 1 $NUMVMS`
do
echo "Creating VM $N"
VBoxManage clonehd HardDisks/ubuntu910disk.vdi HardDisks/ubm${N}disk.vdi --remember
VBoxManage createvm --name ubm$N --register --ostype Ubuntu
VRDPPORT=`expr 10000 + $N`
VBoxManage modifyvm ubm$N --biosbootmenu disabled --memory 64 --vram 6 --boot1 disk --hda HardDisks/ubm${N}disk.vdi --nic1 bridged --bridgeadapter1 wlan0 --vrdp on --vrdpport $VRDPPORT
VBoxManage guestproperty set ubm$N GUESTNAME ubm$N --flags RDONLYGUEST
done
echo ""
echo "VirtualBox's known VMs :"
echo " -------------------------------------------------------------"
VBoxManage list vms
#echo ""
#echo ""
#echo "VirtualBox's known HDDs :"
#echo " -------------------------------------------------------------"
#VBoxManage list hdds
}}}
%%
!! CPU Usage
__Tickless kernel__
Running 5 dsl guests concurrently almost eats 50 % of the host system, I suspect that the non-tickless (2.4) kernel of DSL is the cause of that.
So I did the same clone excercise with a brand new Ubuntu 9.10 (2.6.31 kernel), which has a tickless kernel (CONFIG_NO_HZ).\\
These guests run with 64 MB, 1 GB VDI file (680 MB hda for the guest, the rest is swap).\\
One [caveat with eth0 eth1|http://forums.virtualbox.org/viewtopic.php?f=6&t=20082] , I solved that by removing __ /etc/udev/rules.d/70-persistent-net.rules __
__ CPU Affinity __
Another thing that is mentioned on the forums is that assigning cpu aff. to a process reduces CPU consumption of a guest.\\
Experimented this by running two identical guests for many hours, one with aff. (ubm1) and another one without aff. (ubm2), here are the start commands :
{{{
taskset -c 0 VBoxManage startvm ubm1 --type headless
VBoxManage startvm ubm2 --type headless
}}}
After a couple of hours, we look at the cpu time :
{{{
metskem@gneisenau ~/Downloads $ ps -f -p 10591 10622
UID PID PPID C STIME TTY STAT TIME CMD
metskem 10591 9922 0 Nov03 ? Sl 7:44 /usr/lib/virtualbox/VBoxHeadless --comment ubm1 --startvm 59034198-f98e-447d-896d-cd87cead96c2 --vrdp off
metskem 10622 9922 0 Nov03 ? Sl 12:13 /usr/lib/virtualbox/VBoxHeadless --comment ubm2 --startvm 108de229-caef-4fb8-b4bf-973155c945d1 --vrdp off
}}}
As you can see, this makes quite a difference, 464 seconds versus 733 seconds (__ 37 % less CPU usage __)
Just to be sure I started two additional guests :
{{{
metskem@gneisenau ~/Downloads $ taskset -c 1 VBoxManage startvm ubm3 --type headless
VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Waiting for the remote session to open...
Remote session has been successfully opened.
metskem@gneisenau ~/Downloads $ VBoxManage startvm ubm4 --type headless
VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Waiting for the remote session to open...
Remote session has been successfully opened.
metskem@gneisenau ~/Downloads $ vb list runningvms
VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
"ubm1" {59034198-f98e-447d-896d-cd87cead96c2}
"ubm2" {108de229-caef-4fb8-b4bf-973155c945d1}
"ubm3" {6f01d4b5-1628-428b-9d37-1226a5e774bd}
"ubm4" {bd613011-305d-469a-8492-15977ffdcc49}
}}}
Results:
{{{
metskem@gneisenau ~/vbox $ ps -f -p 17654 17687
UID PID PPID C STIME TTY STAT TIME CMD
metskem 17654 9922 0 Nov04 ? Sl 4:33 /usr/lib/virtualbox/VBoxHeadless --comment ubm3 --startvm 6f01d4b5-1628-428b-9d37-1226a5e774bd --vrdp off
metskem 17687 9922 0 Nov04 ? Sl 5:01 /usr/lib/virtualbox/VBoxHeadless --comment ubm4 --startvm bd613011-305d-469a-8492-15977ffdcc49 --vrdp off
}}}
At line 777 added 160 lines
* set UTC=no in ''/etc/default/rcS'' (or dhclient will fail during start, and you get a DHCP address one hour after the boot)
* most proper __start command__ : __'' nohup taskset -c 0 VBoxHeadless --startvm ubm1 &''__
* how to determine the ip address of the guest (DHCP):
{{{
metskem@gneisenau ~/vbox $ vb guestproperty enumerate ubuntu910 | grep IP
Name: /VirtualBox/GuestInfo/Net/0/V4/IP, value: 10.0.0.177, timestamp: 1257594803542047000, flags:
}}}
* what irritated me is that the output of the VBoxManage command is always cluttered with Sun advertisement :
{{{
VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
}}}
also the long command name VBoxManage with two capitals in it is not quick to type, so I got rid of that by create this one line script :
{{{
VBoxManage $* |grep -v 'VirtualBox Command Line Management Interface Version' | grep -v 'Sun Microsystems, Inc.' | grep -v 'All rights reserved'
}}}
* you cannot assign more than one CPU, if you do it looks like it needs hw-virt, in VirtualBox gui you cannot even select more than one cpu, with the commandline you can, but it won't boot (even if ''--hwvirtex off'' has been set) :
{{{
Error: failed to start machine. Error message: VT-x is not available. (VERR_VMX_NO_VMX).
Unknown error creating VM (VERR_VMX_NO_VMX)
}}}
!! "Resize harddisk"
Sooner or later you run into the situation that your guest's hda is full, and you need a larger one.\\
Do the following :
* create a new (larger) vdi ''vb createhd --filename HardDisks/ubuntu910disk.vdi --size 1500M --remember''
* attach it to the guest: ''vb modifyvm --hdb HardDisks/ubuntu910disk.vdi''
* boot the VM
* logon and copy disks : ''sudo dd if=/dev/sda of=/dev/sdb bs=2M''
* shutdown VM
* reassign disk for VM:
** ''vb modifyvm ubuntu910_minimal --hda none --hdb none
** ''vb modifyvm ubuntu910_minimal --hda HardDisks/ubuntu910disk.vdi''
* reboot the VM
* now the physical disk is larger, but you are not there yet (this guest uses LVM :-) ) :
* ''fdisk /dev/sda3'' , create new primary partition (nr3), write partition table and quit
* signal the kernel that partition table has changed : ''partprobe''
* create new physical volume : ''pvcreate /dev/sda3''
* add it to the existing volume group ''vgextend ubuntuminimal /dev/sda3''
* extend the logical volume: ''lvextend --size +532M /dev/ubuntuminimal/root''
* resize the filesystem: ''resize2fs /dev/mapper/ubuntuminimal-root 1160M''
!! Performance
! tar -czvf
I wanted to get an idea of much overhead there is, so comparing running a load on native hardware against running under VirtualBox.\\
Now you do a complete study on this subject, but no time for that.
I did just one very simple test :
{{{
metskem@ubm7:/tmp$ time tar -czf /tmp/ff.tar /usr/*
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
real 1m20.259s
user 0m27.586s
sys 0m27.286s
}}}
Then scp this tar file to the host, untar it to a temp directory and tar it again in the same way :
{{{
metskem@gneisenau /tmp/fff $ time tar -czf /tmp/ffnative.tar usr
real 0m29.273s
user 0m26.282s
sys 0m1.284s
}}}
||type||host ||guest
|real|29|80
|user|26|28
|sys|1|27
This is rather disappointing, I like to do some testing with a Java workload....
! ant compile jspwiki
{{{
metskem@ubm7:~/jspwiki$ time ant clean compile
Buildfile: build.xml
clean:
[delete] Deleting directory /home/metskem/jspwiki/build
[mkdir] Created dir: /home/metskem/jspwiki/build/tests/classpath
init:
[mkdir] Created dir: /home/metskem/jspwiki/build/classes
compile:
[javac] Compiling 431 source files to /home/metskem/jspwiki/build/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL
Total time: 15 seconds
real 0m16.701s
user 0m3.372s
sys 0m7.512s
}}}
{{{
metskem@gneisenau /tmp/fff/jspwiki $ time ant clean compile
Buildfile: build.xml
clean:
[delete] Deleting directory /tmp/fff/jspwiki/build
[mkdir] Created dir: /tmp/fff/jspwiki/build/tests/classpath
init:
[mkdir] Created dir: /tmp/fff/jspwiki/build/classes
compile:
[javac] Compiling 431 source files to /tmp/fff/jspwiki/build/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL
Total time: 10 seconds
real 0m10.653s
user 0m17.541s
sys 0m0.744s
}}}
||type||host (taskset -c 1)||host ||guest (taskset -c 1)||guest
|real|17|11|17|20
|user|16|18|3|4
|sys|1|1|8|9
This is a strange result, the host takes 18 user seconds versus 3 user seconds in the guest, for the host the wall-clock time is less than the sum of user and sys (2 cores, that's why ?), ............Yes indeed, that's why :
{{{
metskem@gneisenau /tmp/fff/jspwiki $ time taskset -c 1 ant clean compile
Buildfile: build.xml
clean:
[delete] Deleting directory /tmp/fff/jspwiki/build
[mkdir] Created dir: /tmp/fff/jspwiki/build/tests/classpath
init:
[mkdir] Created dir: /tmp/fff/jspwiki/build/classes
compile:
[javac] Compiling 431 source files to /tmp/fff/jspwiki/build/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL
Total time: 16 seconds
real 0m16.766s
user 0m15.897s
sys 0m0.816s
}}}