Feb 23 2009

Port forwarding from Host to Guest in VirtualBox using NAT

VirtualBox’s GUI doesn’t expose this functionality, but the VBoxManage command line utility does. Before starting, remember to close your virtual machine before changing it’s configuration.

You need five pieces of information:

  • your virtual machine’s name in VirtualBox
  • a descriptive name for your port forward
  • the guest port
  • the host port
  • the protocol to use (TCP or UDP).

These three terminal commands are used to set up the port forward (replace bold sections with your information):
VBoxManage setextradata GuestName “VBoxInternal/Devices/pcnet/0/LUN#0/Config/DescriptiveName/HostPort� HostPort

VBoxManage setextradata GuestName “VBoxInternal/Devices/pcnet/0/LUN#0/Config/DescriptiveName/GuestPort� GuestPort

VBoxManage setextradata GuestName “VBoxInternal/Devices/pcnet/0/LUN#0/Config/DescriptiveName/Protocol� Protocol

For Example:

fenris@thinkbuntu:~/Documents$ VBoxManage setextradata OpenSolaris “VBoxInternal/Devices/e1000/0/LUN#0/Config/SSH/HostPort” 2222
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

fenris@thinkbuntu:~/Documents$ VBoxManage setextradata OpenSolaris “VBoxInternal/Devices/e1000/0/LUN#0/Config/SSH/GuestPort” 22
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

fenris@thinkbuntu:~/Documents$ VBoxManage setextradata OpenSolaris “VBoxInternal/Devices/e1000/0/LUN#0/Config/SSH/Protocol” TCP
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

In this case, you could now connect via SSH to the guest though port 2222 on the host:
ssh -p 2222 localhost

The guest is available from other machines on the network as well though the same port at the host’s IP address (if your firewall allows it).

You can set up as many port forwards as you wish, just keep changing your DescriptiveName value. To remove a port forward, repeat the same three commands again, but without the values:
VBoxManage setextradata OpenSolaris "VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/HostPort"
VBoxManage setextradata
OpenSolaris "VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/GuestPort"
VBoxManage setextradata
OpenSolaris "VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/Protocol"

You can view the configuration for a virtual machine, including port forwards, with this command:
VBoxManage getextradata GuestName enumerate

fenris@thinkbuntu:~/Documents$ VBoxManage getextradata OpenSolaris enumerate
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/LastCloseAction, Value: powerOff
Key: GUI/LastWindowPostion, Value: 231,5,720,447
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/SSH/HostPort, Value: 2222
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/SSH/GuestPort, Value: 22
Key: VBoxInternal/Devices/e1000/0/LUN#0/Config/SSH/Protocol, Value: TCP

One restriction you should be aware of is that you can’t use a host port lower than 1024 without running VirtualBox with escalated privilages.

Extra note: You can always access your host from inside your guest using the IP address 10.0.2.2 if you need to do the reverse of this.


Feb 19 2009

Upgrading OpenSolaris 2008.05 to OpenSolaris 2008.11

fenris@thinkbuntu:~/Documents$ ssh 10.x.x.234
The authenticity of host ’10.x.x.234 (10.x.x.234)’ can’t be established.
RSA key fingerprint is bf:f4:91:6e:29:ce:16:12:7d:a7:71:05:fd:8f:08:7c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ’10.x.x.234′ (RSA) to the list of known hosts.
Password:
Last login: Thu Feb 19 11:21:37 2009
Sun Microsystems Inc.   SunOS 5.11      snv_86  January 2008
-bash-3.2$ BUILD=`uname -v | sed -e “s/snv_//” -e “s/[a-z]//”`
-bash-3.2$ pfexec pkg refresh
-bash-3.2$ pfexec pkg install entire@0.5.11-0.${BUILD}
PHASE                                        ACTIONS
Update Phase                                     1/1
Install Phase                                    3/3
-bash-3.2$ pfexec pkg install SUNWipkg@0.5.11-0.${BUILD}
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    3/3     270/270     2.91/2.91

PHASE                                        ACTIONS
Removal Phase                                  18/18
Update Phase                                 126/126
Install Phase                                179/179

-bash-3.2$ pfexec pkg install SUNWinstall-libs
PHASE                                          ITEMS
Indexing Packages                            527/527
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1         4/4     0.07/0.07

PHASE                                        ACTIONS
Removal Phase                                    6/6
Install Phase                                    5/5
Update Phase                                     4/4
Reading Existing Index                           9/9

Indexing Packages                                1/1
-bash-3.2$ pfexec pkg image-update
Creating Plan

DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                603/603 48770/48770 632.69/632.69

PHASE                                        ACTIONS
Removal Phase                            15487/15487
Install Phase                            27493/27493
Update Phase                             66731/66731
PHASE                                          ITEMS
Reading Existing Index                           9/9
Indexing Packages                            603/603
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 267 sectors starting at 50 (abs 16115)

A clone of opensolaris exists and has been updated and activated.
On the next boot the Boot Environment opensolaris-1 will be mounted on ‘/’.
Reboot when ready to switch to this updated BE.

—————————————————————————
NOTE: Please review release notes posted at:

http://opensolaris.org/os/project/indiana/resources/relnotes/200811/x86/

—————————————————————————


Feb 18 2009

Compile Kopete in Kubuntu

Hmm .. for a past a few month im using pidgin in Kubuntu since Kopete got bugs with Yahoo Messenger (YM) … so today i’ve compiled it while in meeting ( hehe bored ). so what did i do ?

Requirement :

sudo apt-get install kdevelop-kde4 kdevplatform kdevelop-dev-kde4 kdevelop-data-kde4 kdepimlibs5 kdepimlibs5-dev sqlite3 libsqlite3-dev libqimageblitz4 libqimageblitz-dev

SVN the latest kopete code :

svn co -N svn://anonsvn.kde.org/home/kde/branches/KDE/4.2/kdenetwork
cd kdenetwork
svn up kopete cmake

Next,

mkdir ../kdenetwork-build
cd ../kdenetwork-build
cmake ../kdenetwork
make

………wait while it compiling everything ……….
sudo make install

…….waiting building the binary and installing …….

Then ..

try your kopete that u already compiled … hope it solve/fixed the bugs ….this is temporary fixed while waiting the Kubuntu team repackage the kopete with the latest SVN

Enjoyed ya messanging ……..



Feb 16 2009

Accessing OpenOffice.org User Profiles on an LDAP Server

OpenOffice.org can use an LDAP User Profile Back End to access user profiles, such as first name, last name, and address, on an LDAP server. As a result, you do not need to manually enter user profiles when you install OpenOffice.org on a network.

To retrieve user profiles for OpenOffice.org from an LDAP repository, you need to provide the LDAP User Profile Back End with the following information:

  • Location of the LDAP repository
  • Mapping file that identifies the attributes in the LDAP repository that are required to generate an OpenOffice.org user profile

For more detail how to access OO on LDAP Server, refer here


Feb 16 2009

WordPress 2.7.1

2.7.1, the first 2.7 maintenance release, is now available.  2.7.1 fixes 68 tickets.  You can automatically upgrade from 2.7 to 2.7.1 via the Tools->Upgrade menu, or you can download the package and upgrade manually. Consult the list of fixed tickets and the  full set of changes between 2.7 and 2.7.1 for details.


Feb 8 2009

BZ …..

hmm .. its been more than 2 week that im not posting anything …. bz doing things until forget that i have a blog to post …

actually .. bz in sense of learning curve … learning / deeper in few things such as postgres , OpenLDAP , phpldapadmin, ldap admin manager (LAM) … for now .. its still base on my daily task . its about OSCC product ( myWorkspace ). basically .. its about horde webmail + postgres + Open LDAP …

learning migration from vpasswd to /etc/passwd & /etc/shadow, user to dbmail, dbmail to OLDAP using bash script … n ETC2 …

its quite challenging to me since its kinda 1st time for me .. but thanks god that i can cope everything … beside that .. im back refreshing my skills with Joomla & phpBB3 . migrating old phpnuke cms to joomla & porting out phpbb in phpnuke to standalone for PingPong community in Malaysia . thanks to ameck for his Universal *-NUKE CMS convertor . with the convertor i successfully convert phpbb inside phpnuke to standalone phpBB3 … hope PP4M’s user enjoy their new portal.

beside that .. i just get info a few days back that … Ubuntu-my community  need to be ready for kind a big event middle of these year. full info i cant release yet until the event already been confirm & get official. so Ubunturian in Malaysia …. alert & beware !!!

anyone out there .. who willing to share his/her knowledge about OLDAP ……. u guys r most welcome to me … i think thats all for now .. cau cen dol …


Get Adobe Flash playerPlugin by wpburn.com wordpress themes