Skip to Content

How to install VirtualBox Guest Additions in Puppy Linux 4.0

labrador 的头像

The short version

Install the VirtualBox Guest Additions for PUP4 pet package.

The long version

First of all, start Puppy in VirtualBox. When you were asked which X server to use, please note that you have to choose the XVesa mode, since Xorg won't work until the guest additions have been installed.

Prepare the kernel source

Download the proper kernel source code for your Puppy. For example, Puppy Linux 4.0 uses linux kernel 2.6.21.7, which can be found here. Then, uncompress the kernel source and place a symbol link linux pointing to the kernel directory in /usr/src/ as follows.
# mkdir -p /usr/src/
# tar -C /usr/src/ -jxf linux-2.6.21.7.tar.gz
# ln -sf linux-2.6.21.7 /usr/src/linux
Extract DOTconfig-K2.6.xx.x from Puppy Unleashed Core to /usr/src/linux, and rename it to .config. Or you can download DOTconfig-K2.6.21.7 directly if you are using Puppy 4.0.

Now compile the neccessary headers and scritps in the kernel.
# make -C /usr/src/linux oldconfig prepare scripts

Run VBoxLinuxAdditions installer

At this moment, the X server running in the Puppy is Xvesa. However, VBox Guest Additions have no idea about Xvesa, so we have to pretend that the system is running Xorg by changing the symbol link of X as follows:
ln -sf Xorg /usr/X11R7/bin/X
Select Devices->Install Guest Additions... on the VirtualBox menu, then switch back to the virtual machine and mount the VBOX CD-ROM by using pmount on the desktop. The ROX file manager will pop up and show the contents of the virtual CD. Click the VBoxLinuxAdditions.run icon and the VirtualBox Guest Additions will be installed in few minutes.

Do some hacking

Download and copy libshadowfb.so to /usr/X11R7/lib/xorg/modules/. Xorg needs this library to start up.

Insert following lines at the begining of /root/.xinitrc to enable clipboard sharing and auto-resize guest display.
killall -9 VBoxClient
/usr/bin/VBoxClient
Sometimes VBoxClient doesn't quit after restarting Xorg and eats up all the cpu resource. The first line is to prevent this by killing all the previous VBoxClient instances.

Download and extract boot scripts and xorg.conf to /etc/. The default scripts installed by VirtualBox don't work well under Puppy, so I made some minor modifications. Here's the patch:
diff -u /etc/rc.d/functions etc/rc.d/functions
--- /etc/rc.d/functions	2008-08-03 23:28:54.000000000 -0400
+++ etc/rc.d/functions	2008-08-03 21:34:47.000000000 -0400
@@ -99,7 +99,7 @@
 # $base in this case
 #
 
-        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID $base)
 
         pid=""
 
@@ -180,7 +180,7 @@
 # $base in this case
 #
 
-        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID $base)
 
         pid=""
 
@@ -327,7 +327,7 @@
 # $base in this case
 #
 
-        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID $base)
 
         pid=""
 
@@ -405,7 +405,7 @@
 # $base in this case
 #
 
-        pidlist=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $base)
+        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID $base)
 
         pid=""
 
@@ -453,7 +453,7 @@
 # $pid will contain a list of PID's that belong to a process
 #
 
-        pid=$(/sbin/pidof -o $$ -o $PPID -o %PPID -x $1)
+        pid=$(/bin/pidof -o $$ -o $PPID -o %PPID $1)
         if [ -n "$pid" ]
         then
 #
@@ -38,6 +38,8 @@
     system=suse
 elif [ -f /etc/gentoo-release ]; then
     system=gentoo
+elif [ -f /etc/puppyversion ]; then
+    system=puppy
 else
     system=other
 fi
@@ -95,6 +97,29 @@
     fi
 fi
 
+if [ "$system" = "puppy" ]; then
+    . /etc/rc.d/functions
+    daemon() {
+        loadproc $@
+    }
+
+    fail_msg() {
+    	print_status failure
+	}
+
+    succ_msg() {
+    	print_status success
+	}
+    
+    status() {
+    	statusproc $@
+	}
+	
+    begin() {
+        echon $@
+    }
+fi
+
 if [ "$system" = "other" ]; then
     fail_msg() {
         echo " ...fail!"
@@ -113,8 +138,8 @@
 dev=/dev/vboxadd
 modname=vboxadd
 module=$kdir/$modname
-owner=vboxadd
-group=1
+owner=root
+group=root
 
 fail() {
     if [ "$system" = "gentoo" ]; then
@@ -45,6 +45,9 @@
 elif [ -f /etc/gentoo-release ]; then
     system=gentoo
     PIDFILE="/var/run/vboxadd-timesync"
+elif [ -f /etc/puppyversion ]; then
+    system=puppy
+    PIDFILE="/var/run/vboxadd-timesync"
 else
     system=other
     if [ -d /var/run -a -w /var/run ]; then
@@ -123,6 +126,25 @@
     fi
 fi
 
+if [ "$system" = "puppy" ]; then
+    . /etc/rc.d/functions
+    daemon() {
+        loadproc $@
+    }
+
+    fail_msg() {
+        return
+    }
+
+    succ_msg() {
+        return
+    }
+    
+    status() {
+        statusproc $@
+    }
+fi
+
 if [ "$system" = "other" ]; then
     fail_msg() {
         echo " ...fail!"
@@ -149,32 +171,32 @@
 }
 
 start() {
-    if ! test -f $PIDFILE; then
+#    if ! test -f $PIDFILE; then
         echo -n "Starting VirtualBox host to guest time synchronisation ";
         vboxaddrunning || {
             echo "VirtualBox Additions module not loaded!"
             exit 1
         }
         daemon $binary --daemonize
-        RETVAL=$?
-        test $RETVAL -eq 0 && touch $PIDFILE
-        succ_msg
-    fi
+#        RETVAL=$?
+#        test $RETVAL -eq 0 && touch $PIDFILE
+#        succ_msg
+#    fi
     return $RETVAL
 }
 
 stop() {
-    if test -f $PIDFILE; then
+#    if test -f $PIDFILE; then
         echo -n "Stopping VirtualBox host to guest time synchronisation ";
         vboxaddrunning || {
             echo "VirtualBox Additions module not loaded!"
             exit 1
         }
         killproc $binary
-        RETVAL=$?
-        test $RETVAL -eq 0 && rm -f $PIDFILE
-        succ_msg
-    fi
+#        RETVAL=$?
+#        test $RETVAL -eq 0 && rm -f $PIDFILE
+#        succ_msg
+#    fi
     return $RETVAL
 }
 
@@ -38,6 +38,8 @@
     system=suse
 elif [ -f /etc/gentoo-release ]; then
     system=gentoo
+elif [ -f /etc/puppyversion ]; then
+    system=puppy
 else
     system=other
 fi
@@ -95,6 +97,29 @@
     fi
 fi
 
+if [ "$system" = "puppy" ]; then
+    . /etc/rc.d/functions
+    daemon() {
+        loadproc $@
+    }
+
+    fail_msg() {
+    	print_status failure
+	}
+
+    succ_msg() {
+    	print_status success
+	}
+    
+    status() {
+    	statusproc $@
+	}
+	
+    begin() {
+        echon $@
+    }
+fi
+
 if [ "$system" = "other" ]; then
     fail_msg() {
         echo " ...fail!"
#6687
comment6
#6853
Hi,

Thanks so much for sharing this. I am a linux newbie. And i just installed Macpup_Foxy3.0 in virtualbox running on vista. i tried installing guest additions in the pupp but i got this:

verifying archive integrity .... all good.
uncompressing virtualbox 3.0.12 guest additions for linux installation ... ..............................................................................................................................................................................................
virtualbox 3.0.12 guest additions installation.
pls install GNU make.
Pls install the build and hearder files for your current linux kernel.
the current kernel version is 2.6.30.5
pls install the GNU compiler.
problems were found which would prevent the guest additions from installing.
pls correct these problems and try again.
press return to close window...


pls i need your help! thanks once more in anticipation of your kind response.

Obi.
#7249
<snip>
First of all, start Puppy in VirtualBox. When you were asked which X server to use, please note that you have to choose the XVesa mode, since Xorg won't work until the guest additions have been installed.
</snip>

It seems not quite true. Xorg works, but the Xorgwizard doesn't.

Have switched back and forth back with Puppy 4.1.2; Xvesa and Xorg display works.

One can change to Xorg, but has to do it "blind" as the screen is black during the process :-|

What's up with that?

[ The default resolution didn't work on my cr**py old box, so I had to do Xvesa blind, too. I got Puppy 4.1.2 as a VMWare appliance. ]

moB
#7250
ps. thank you very much for your clear example and thoughtful notes.

moB

发表新评论

  • 你可以在文本中使用BBCode标记语言。 URL会自动被转为链接。

更多关於格式化选项的信息

CAPTCHA
请验证您是否是机器人。
Image CAPTCHA
Enter the characters shown in the image.