VirtualBox on a RedHat EL 3 server

Discussions related to using VirtualBox on Linux hosts.
Post Reply
wwwillem
Posts: 8
Joined: 14. Feb 2008, 07:10
Location: Calgary
Contact:

VirtualBox on a RedHat EL 3 server

Post by wwwillem »

Trying to install VirtualBox on a Redhat Enterprise Linux 3 u7 server (kernel 2.4.21), which gave the error "Please install the build and header files for your current Linux kernel.".

Because RH EL 3 doesn't come with the kernel-devel package, I installed kernel-source instead.

Then analyzing what the install script does, I noticed it is looking for a directory /usr/src/linux. But RH EL 3 calls that /usr/src/linux-2.4. This could be resolved with:

# cd /usr/src/
# ln -s linux-2.4.21-40.EL linux

I'm not out of the woods yet, but this was the first step to get there. The install now complains that my kernel configuration has modules disabled and requires building a new kernel. Which surprises me a little, 'lsmod' shows loadable modules.

We'll see . . . .
wwwillem
Posts: 8
Joined: 14. Feb 2008, 07:10
Location: Calgary
Contact:

Post by wwwillem »

Also figured out the next hurdle. The error was:

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

But, this is the wrong warning, because loadable module support was already enabled!!

I did some googling and found on a Turbo Linux forum the following tip:

# cp /usr/src/linux/configs/kernel-2.4.21-i586.config /usr/src/.config

To be on the safe side, I also did:

# cp /usr/src/linux/configs/kernel-2.4.21-i586.config /usr/src/linux/.config

OK, now I've to resolve an issue caused by having different versions for the kernel sources I'm using and the actual kernel I have (which is 2.4.25).
wwwillem
Posts: 8
Joined: 14. Feb 2008, 07:10
Location: Calgary
Contact:

Post by wwwillem »

OK, the last piece of my puzzle (at least for tonight) was that my kernel-source package was version 2.4.21-40.EL and my actual kernel (check with 'uname -r') was 2.4.25.

First thing was to rename in /usr/src the linux-2.4.21-40.EL directory and create a couple more symbolic links:

# cd /usr/src
# mv linux-2.4.21-40.EL linux-2.4.25
# ls -l
total 12
lrwxrwxrwx 1 root root 12 Feb 13 23:46 linux -> linux-2.4.25
lrwxrwxrwx 1 root root 12 Feb 13 23:46 linux-2.4 -> linux-2.4.25
lrwxrwxrwx 1 root root 12 Feb 14 00:02 linux-2.4.21-40.EL -> linux-2.4.25
drwxr-xr-x 16 root root 4096 Feb 13 23:58 linux-2.4.25

Then I had some mess in /lib/modules. The install of VirtualBox created a /lib/modules/2.4.25 directory in parallel with the existing one. So, I wiped that one out, renamed the 2.4.21 to 2.4.25 and added another symlink:

# ls -l
total 4
lrwxrwxrwx 1 root root 6 Feb 14 00:16 2.4.21-40.EL -> 2.4.25
drwxr-xr-x 4 root root 4096 Feb 14 00:31 2.4.25

Then I did some more find/grep combo's and I guess the most important change was in /usr/src/linux/include/linux/version.h, where I also changed 132117 to:

#define LINUX_VERSION_CODE 132121
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

do the math.....

Finally I still had some problems, I checked out /tmp/vbox.#, tried to do a make there, debugged the makefile a little and discovered I could fix it by adding a "KERN_DIR = /usr/src/linux-2.4.25" line. Then the make went fine.

So, finally, I created an environment variable with:

# export KERN_DIR=/usr/src/linux-2.4.25

and did again:

# ./VirtualBox_1.5.4_Linux_x86.run --keep install /opt/virtualbox

and bingo!! the build went fine. Now I've to read the UserGuide a bit further and see how I can start VirtualBox and build a guest OS. But not tonight.... :-)

--
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

wwwillem: Your effort is very nice indeed. I haven't tried to run VBox on Linux 2.4 Host. But it worked for me on and old Linux 2.6.8 host (Mandrake Linux 10.1).

I believe, however, that you made a big mistake: You cannot match between kernel 2.4.25 and sources for 2.4.21-EL.

Install both kernel+kernel-sources from your RHEL 3 CD/DVD, and boot into kernel, that matches the sources.

-Technologov
wwwillem
Posts: 8
Joined: 14. Feb 2008, 07:10
Location: Calgary
Contact:

Post by wwwillem »

I guess you're right. After my posts I tried to build the vboxdrv.o module (which built OK) but then failed to "modprobe". My next try will be to build the whole thing on a standard EL 3 box and then move over the various VB bits and pieces to my system with the 2.4.25 kernel.

Will keep you all posted.

--
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

wwwillem: You cannot do this. Linux has no backward/forward compatibility, especially not for drivers.

Work with standard RHEL3 kernel. (or expect problems)

-Technologov
wwwillem
Posts: 8
Joined: 14. Feb 2008, 07:10
Location: Calgary
Contact:

Summary VirtualBox on Redhat EL3 u7

Post by wwwillem »

So, this is what you have to do to install VB on RH EL3u7. Because qt is too old, you won't be able to start the GUI. I didn't try to upgrade qt to a more recent version.

=================================

# uname -a
Linux lifebook 2.4.21-40.EL #1 Thu Feb 2 22:32:00 EST 2006 i686 i686 i386 GNU/Linux

# rpm -q kernel-source
kernel-source-2.4.21-40.EL

# rpm -q SDL
SDL-1.2.5-6
# rpm -q qt
qt-3.1.2-13.4

# cp /usr/src/linux-2.4.21-40.EL/configs/kernel-2.4.21-i686.config /usr/src/linux-2.4.21-40.EL/.config

# export KERN_DIR=/usr/src/linux-2.4.21-40.EL/

# ./VirtualBox_1.5.4_Linux_x86.run install /opt/virtualbox

# tail -f /var/log/vbox-install.log

# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Removing old VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [ OK ]
# /etc/init.d/vboxdrv restart
Stopping VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [ OK ]
# /etc/init.d/vboxdrv status
VirtualBox kernel module is loaded.

# cd /opt/virtualbox/

# export PATH=$PATH:/opt/virtualbox

# echo $LD_LIBRARY_PATH
# export LD_LIBRARY_PATH="/opt/virtualbox"
# echo $LD_LIBRARY_PATH
/opt/virtualbox

=======================================

Willem

--
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

wwwillem: Yea... if Qt is old it may be a real pain. So, did you try VBoxSDL ? It behaves similarly to Qemu this way. (not speed, but experience)
wwwillem
Posts: 8
Joined: 14. Feb 2008, 07:10
Location: Calgary
Contact:

Post by wwwillem »

I'm not worried about qt, I will anyway probably go "headless" RDP.

Maybe you have some advice for me. So, I have VirtualBox running on a regular server with standard RH EL3u7. But what I'm targetting is to run it on my modified Cobalt RAQ4's. They don't have the original OS anymore, I upgraded them to RH EL3u7, but at the time, I had to replace the standard RH kernel with a 2.4.25 version that contains some Cobalt specific additions. And I only have the vmlinuz.bz2 file and the (kernel build) config file.

What I tried today, is download linux-2.4.25.tar.gz from kernel.org, save it in /usr/src/linux-2.4.25, copy-in my .config file, then do "make oldconfig" and "make dep". Next I set KERN_DIR=/usr/src/linux-2.4.25 and then I run "./VirtualBox_1.5.4_Linux_x86.run --keep install". I only had to make a minor tweak in my memobj-r0drv-linux.c (because of .21 and .25 differences in pgtable.h), but after that I had no problem building the vboxdrv.o module.

When I now try to load it with "insmod /tmp/vbox.1/vboxdrv.o", I get these errors:

./vboxdrv.o: unresolved symbol vmap_R48cc428a
./vboxdrv.o: unresolved symbol remove_wait_queue_Rdc2d558c
./vboxdrv.o: unresolved symbol do_munmap_R1012bbfa
./vboxdrv.o: unresolved symbol zone_table_Rdde9f344
./vboxdrv.o: unresolved symbol misc_deregister_Rb8fade3f
./vboxdrv.o: unresolved symbol misc_register_R50dd567c
./vboxdrv.o: unresolved symbol change_page_attr_R00fe5169
./vboxdrv.o: unresolved symbol get_user_pages_R041b6b8f
./vboxdrv.o: unresolved symbol _alloc_pages_R5de7dcf4
./vboxdrv.o: unresolved symbol do_mmap_pgoff_R0d069c1b
./vboxdrv.o: unresolved symbol add_wait_queue_R6c8741cc
./vboxdrv.o: unresolved symbol mem_map_R755ca612
./vboxdrv.o: unresolved symbol __free_pages_Racbe33c8

OK, I've never been a kernel hacker. Even never built one myself, although I'm sure I could do it. My confusion lies in the fact that my kernel is 2.4.25, all my (shared) libraries are 2.4.21 (true ??), but I've built my module against the 2.4.25 kernel-sources. So, I would think that I should be OK, but clearly I'm not.

Any tips & tricks are welcome. It would be so cool to run Solaris on a Cobalt?

--
Post Reply