HOWTO install vmware beta on gentoo

From Chaos

Jump to: navigation, search
This article is part of the HOWTO series.

Contents

OBSOLETE

Summary

  • I wrote this howto to remind myself on how I setup vmware on Gentoo. Gentoo is an awesome Linux distro, and most of the stuff here is going to be pretty propietary to Gentoo. It might work on other systems, YMMV.

Prerequisites

  • This HOWTO assumes the following things:
    • That you already have gentoo installed on a system, with the below packages installed (some of them are not required by vmware, the ones that are required are in bold).
      • net-misc/grdesktop
      • sys-kernel/gentoo-sources
      • net-misc/tightvnc
      • gnome-base/gnome
      • app-admin/syslog-ng
      • app-editors/vim
      • sys-kernel/genkernel
      • sys-process/vixie-cron
      • sys-apps/ethtool
      • app-admin/webmin
      • sys-apps/coldplug
      • sys-apps/xinetd
      • net-analyzer/net-snmp
      • app-misc/screen
      • sys-boot/lilo
      • net-misc/ntp
      • www-client/mozilla-firefox
      • sys-libs/db-3.2.9-r10
      • net-analyzer/tcpdump
    • That you know Linux relatively well.
    • I also used special USE flas in /etc/make.conf, since I don't need ipv6 and kde: USE="-kde -ipv6"

Details

Setup System Libraries

1. First, we need to setup some libraries that VMWare will need. The following is required by older versions of apache, and must be done so httpd.vmware can be started.

root@vmware:~# emerge =sys-libs/db-3.2.9-r10
root@vmware:~# cd /usr/lib
root@vmware:/usr/lib# ln -s libdb-3.2.so libdb.so.3

2. There are also some crypto and ssl libs we need to symlink so we can use SSL:

root@vmware:/usr/lib# ln -s libcrypto.so.0.9.7 libcrypto.so.4
root@vmware:/usr/lib# ln -s libssl.so.0.9.7 libssl.so.4

Setup VMWare Server

1. We can now continue with the main VMWare installation. Download the VMWare Server and MUI tar packages from VMWare's site.

2. Now, unpack them in root, change directory to 'vmware-server-distrib', and start the installer:

root@vmware:~# cd vmware-server-distrib
root@vmware:~/vmware-server-distrib# ./vmware-install.pl

3. Most of the questions should be straightforward. The ones I got stuck on are:

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
What I did to fix this was to login to my vmware server again, and make the /etc/rc.d/rc{0-6}.d/ directories, and then told the installer to use /etc/rc.d. You can remove these later.
root@vmware:~# perl -e 'foreach (0..6) { system("mkdir -p /etc/rc.d/rc$_.d/"); }'
What is the directory that contains the init scripts?
This is easy enough, it's actually /etc/init.d.
Do you want to be able to use NAT networking in your virtual machines? (yes/no)
I actually do not use NAT in my vmware machines, so I do not need to enable this. If you need NAT, you're on your own.
Do you want to be able to use host-only networking in your virtual machines?
Since I don't even really know what this is, I don't need it. If you need this particular feature, you're on your own.
In which directory do you want to keep your virtual machine files?
Since I have a 13GB partition that mounts to /usr/local/vmware, I opted to put my machine files there.

Setup VMWare Console

1. Change directory to 'vmware-server-distrib', and start the installer:

root@vmware:~# cd vmware-mui-distrib
root@vmware:~/vmware-mui-distrib# ./vmware-install.pl

2. Again, most of the questions should be straightforward, but I did have a couple that were a bit tricky.

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
I chose /etc/rc.d again, making sure rc{0-6}.d existed.
What is the directory that contains the init scripts?
As we have previously I told it to use /etc/init.d.
In which directory do you want to install the VMware Management Interface
I was definately a bit confused about this, so I told it to just install it to /usr/local/vmware-mui, which worked perfectly.

Setup VNC

1. Since I will be accessing my VMWare machine remotely 99% of the time, I decided to setup vncserver. First, start vncserver with the following parameters. This must be done as root!

root@vmware:~# vncserver -name vmware -geometry 1024x768 -depth 16 :0

2. Once it started up successfully, go ahead and kill it by issuing this command:

root@vmware:~# vncserver -kill :0

3. We now need to modify /root/.vnc/xstartup to start up gnome once vncserver is started. The bottom line should have something like 'twm &'. Delete it, and add a line that reads 'gnome-session &'. Save the file and exit.

root@vmware:~/.vnc# vi xstartup

4. Now, modify /etc/bash/bashrc, and add 2 aliases so you can quick start and stop vncserver. Save and exit the file:

root@vmware:~# vi /etc/bash/bashrc
alias startvnc="vncserver -name vmware -geometry 1024x768 -depth 16 :0"
alias stopvnc="vncserver -kill :0"

Setup rc scripts

  • The stock httpd.vmware and vmware startup scripts that are in /etc/init.d suck. I have included copies of ones that I have written, please make backups and replace them with my version as necessary. Don't forget to run depscan.sh --update. We are going to call /etc/init.d/vmware.sh by /etc/init.d/vmware, which is a standard runscript.
root@vmware:~# cd /etc/init.d
root@vmware:/etc/init.d# mv vmware vmware.sh
root@vmware:/etc/init.d# mv httpd.vmware /root/httpd.vmware.BAK
root@vmware:/etc/init.d# vi httpd.vmware
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# This file is used to start httpd.vmware

depend() {
        use logger dns
        need net
        after xinetd
}

INSTALLDIR=/usr/local/vmware-mui
USE_SSL="-DSSL_ONLY"

start() {
        ebegin "Starting ${SVCNAME}"
        $INSTALLDIR/apache/bin/httpd -DSSL $USE_SSL -DGSX -d $INSTALLDIR/apache 2> /dev/null
        touch /var/lock/subsys/httpd.vmware
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --quiet --pidfile /var/run/vmware/httpd/httpd.pid
        rm -f /var/lock/subsys/httpd.vmware
        eend $?
}
root@vmware:/etc/init.d# cp httpd.vmware vmware
root@vmware:/etc/init.d# vi vmware
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# This file is used to start vmware

depend() {
        use logger dns
        need net
        after xinetd
}


start() {
        ebegin "Starting ${SVCNAME}"
        /etc/init.d/vmware.sh start 1> /dev/null
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        /etc/init.d/vmware.sh stop 1> /dev/null
        eend $?
}
  • Enable rc-update to start vmware and httpd.vmware in the default runlevel:
root@vmware:/etc/init.d# rc-update add vmware default
root@vmware:/etc/init.d# rc-update add httpd.vmware default
root@vmware:/etc/init.d# depscan.sh --update
root@vmware:/etc/init.d# rc-update show
        httpd.vmware |      default
              vmware |      default
  • Remove /etc/rc.d:
root@vmware:/etc/init.d# rm -rf /etc/rc.d
  • Reboot and Enjoy! You should be able to log in to VNC and start the VMWare console, or go to https://<myhostorip>:8333/, and login with the root login/password from the host system.

References

Personal tools
Sponsored Links