本教程一步步地教导你怎样在Ubuntu 9.10桌面系统中安装 VMware Server 1.0.x (撰写本文时是1.0.10) . 这适合于那些偏爱VMware Server 1.0.x而不是VMware Server 2的用户.
使用VMware Server你可以在主机操作系统中创建并安装客户操作系统 (“虚拟机器”) 比如 Linux, Windows, FreeBSD, 等等. 这样你可以获得一些益处,比如你可以在同一套硬件上运行多个操作系统,节省很多费用。你还可以将虚拟机从一个VMware Server迁移到另一个Server (也可以迁移到一个装有VMware Player的系统,那玩意也是免费的).
同时,使用VMware Server你还可以让你的最老的Windows桌面跑在你的Ubuntu桌面之上 (之前你需要通过VMware Converter将其转化成VMware虚拟机, 就像下面这个教程中描述的那样。有时候这非常有用,如果你依赖一些只能存在于Windows的应用程序,或者想慢一点转换到Linux的话。
我并不能做出任何保证说这种办法一定可以适用于你!
安装 VMware Server 1.0.x
想下载VMware Server可以来这里点击那个VMware Server 1.0.10 的链接:
在接下来的页面,点击VMware Server for Linux 旁边的Download按钮(文件类型: tar.gz, 不是 rpm!):
通过点击Yes来接受许可证协议:
然后下载VMware Server for Linux 的.tar.gz 文件 (不是rpm文件!) 到你的电脑 (比如放到 /home/falko/Downloads):
为了得到序列号你需要运行VMware Server, 然后来这里. 填写好你的个人详细信息. 然后你就可以看到一个带有 VMware Server序列号的页面. 将其记下来或者打印下来:
接下来打开终端 (Applications > Accessories > Terminal):
运行下面的命令来安装一些需要的软件包:
sudo aptitude install build-essential xinetd
如果你在x86_64系统上面, 你还需要安装ia32-libs这个包:
sudo aptitude install ia32-libs
然后来到你保存VMware Server的 .tar.gz文件的地方,如 /home/falko/Downloads (将falko换成你自己的用户名!):
cd /home/falko/Downloads
解压VMware Server的 .tar.gz文件并且运行安装程序:
tar xvfz VMware-server-*.tar.gz
cd vmware-server-distrib
sudo ./vmware-install.pl
安装程序会问你一大堆的问题. 当然你总是可以通过简单的敲击 来接受默认的那个值. 不过下面这个问题你要回答no…
Before running VMware Server for the first time, you need to configure it by
invoking the following command: “/usr/bin/vmware-config.pl”. Do you want this
program to invoke the command for you now? [yes]
.. 因为不这么干的话在试图编译VMWare所需要的内核模块时你会遇到一个类似于下面这样的错误 (如果你回答了yes并且碰到了这些错误那也没啥大问题——继续阅读下去即可):
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only’
make -C /lib/modules/2.6.31-14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic’
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config0/vmmon-only/./include/vmware.h:25,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:48:
/tmp/vmware-config0/vmmon-only/./include/vm_basic_types.h:104:7: warning: “__FreeBSD__” is not defined
In file included from /tmp/vmware-config0/vmmon-only/./include/x86.h:20,
from /tmp/vmware-config0/vmmon-only/./include/machine.h:24,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:15,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/x86apic.h:79:1: warning: “APIC_BASE_MSR” redefined
In file included from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/apic.h:11,
from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/smp.h:13,
from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/mmzone_64.h:12,
from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:773,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:12:
/usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/apicdef.h:133:1: warning: this is the location of the previous definition
In file included from /tmp/vmware-config0/vmmon-only/./include/x86.h:21,
from /tmp/vmware-config0/vmmon-only/./include/machine.h:24,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:15,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/x86desc.h:593:7: warning: “_MSC_VER” is not defined
In file included from /tmp/vmware-config0/vmmon-only/./include/machine.h:24,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:15,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/x86.h:830:1: warning: “PTE_PFN_MASK” redefined
In file included from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/paravirt.h:7,
from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/irqflags.h:61,
from include/linux/irqflags.h:57,
from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/system.h:11,
from /usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/processor.h:17,
from include/linux/prefetch.h:14,
from include/linux/list.h:6,
from include/linux/module.h:9,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:12:
/usr/src/linux-headers-2.6.31-14-generic/arch/x86/include/asm/pgtable_types.h:182:1: warning: this is the location of the previous definition
In file included from /tmp/vmware-config0/vmmon-only/./include/vcpuset.h:78,
from /tmp/vmware-config0/vmmon-only/./include/modulecall.h:22,
from /tmp/vmware-config0/vmmon-only/./common/vmx86.h:18,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:16,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:226:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:230:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:298:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:304:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:357:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:402:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:446:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:489:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:533:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:576:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:620:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:663:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:665:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:705:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:748:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:750:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:790:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:831:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:833:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:871:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:912:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:914:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:952:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1073:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1077:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1124:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1329:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1454:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1587:7: warning: “_MSC_VER” is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.h:20,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:37:5: warning: “VMW_HAVE_EPOLL” is not defined
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:43:5: warning: “VMW_HAVE_EPOLL” is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.h:20,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:60: error: conflicting types for a€?poll_initwaita€?
include/linux/poll.h:70: note: previous declaration of a€?poll_initwaita€? was here
In file included from /tmp/vmware-config0/vmmon-only/./include/vm_asm_x86_64.h:23,
from /tmp/vmware-config0/vmmon-only/./include/vm_asm.h:28,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:52:
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86.h:430:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86.h:676:7: warning: “_MSC_VER” is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86.h:716:7: warning: “_MSC_VER” is not defined
In file included from /tmp/vmware-config0/vmmon-only/./include/vm_asm.h:28,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:52:
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86_64.h:40:7: warning: “_MSC_VER” is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/vmhost.h:13,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:71:
/tmp/vmware-config0/vmmon-only/./include/compat_semaphore.h:5:27: error: asm/semaphore.h: No such file or directory
/tmp/vmware-config0/vmmon-only/linux/driver.c:146: error: unknown field a€?nopagea€? specified in initializer
/tmp/vmware-config0/vmmon-only/linux/driver.c:147: warning: initialization from incompatible pointer type
/tmp/vmware-config0/vmmon-only/linux/driver.c:150: error: unknown field a€?nopagea€? specified in initializer
/tmp/vmware-config0/vmmon-only/linux/driver.c:151: warning: initialization from incompatible pointer type
/tmp/vmware-config0/vmmon-only/linux/driver.c: In function a€?LinuxDriver_Ioctla€?:
/tmp/vmware-config0/vmmon-only/linux/driver.c:1650: error: a€?struct task_structa€? has no member named a€?euida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1650: error: a€?struct task_structa€? has no member named a€?uida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1651: error: a€?struct task_structa€? has no member named a€?fsuida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1651: error: a€?struct task_structa€? has no member named a€?uida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1652: error: a€?struct task_structa€? has no member named a€?egida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1652: error: a€?struct task_structa€? has no member named a€?gida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1653: error: a€?struct task_structa€? has no member named a€?fsgida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1653: error: a€?struct task_structa€? has no member named a€?gida€?
/tmp/vmware-config0/vmmon-only/linux/driver.c:1670: error: too many arguments to function a€?smp_call_functiona€?
make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic’
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmmon-only’
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at “http://www.vmware.com/download/modules/modules.html” and
“http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html”.
Execution aborted.
falko@falko-desktop:~/Downloads/vmware-server-distrib$
然后这么干:
cd /home/falko/Downloads
wget -c http://www.insecure.ws/warehouse/vmware-update-2.6.31-5.5.9.tar.bz2
tar xvfj vmware-update*.tar.bz2
在结束VMware Server安装之前, 我们必须编译一个开启了init_mm特征的新内核. 先变成root…
sudo su
… 接着安装内核源码:
aptitude install linux-source-2.6.31
接下来我们安装一些编译内核所需要的软件包:
aptitude install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge build-dep linux libncurses5-dev kernel-package
如果在命令执行过程中你看到说一个新内核已经安装好时,请重启一下系统:
reboot
现在再次变成root:
sudo su
接着这么干:
cd /usr/src
tar xvfj linux-source-2.6.31.tar.bz2
cd linux-source-2.6.31
打开 arch/x86/kernel/init_task.c…
gedit arch/x86/kernel/init_task.c
… 在文件的尾部添加这么一行 EXPORT_UNUSED_SYMBOL(init_mm); 要在 DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS;的后面:
[…]
DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS;
EXPORT_UNUSED_SYMBOL(init_mm);
然后将当前内核的配置文件拷贝到内核源码目录…
cp /boot/config-`uname -r` .config
… 并且运行:
make menuconfig
在内核配置菜单上选择Load an Alternate Configuration File…
… 填上.config并选择Ok:
然后选择内核配置主菜单上的Exit…
… 接下来当你问到Do you wish to save your new kernel configuration?时选择Yes
然后运行
make-kpkg clean
fakeroot make-kpkg –initrd –append-to-version=-custom kernel_image kernel_headers
来编译新内核. 这里需要大量的时间所以耐心一点.
在这之后你会在/usr/src/目录发现一个linux-image和一个linux-headers的 .deb包:
cd /usr/src/
ls -l
root@falko-desktop:/usr/src# ls -l
total 461180
drwxr-xr-x 23 root root 4096 2009-10-27 19:16 linux-headers-2.6.31-14
drwxr-xr-x 7 root root 4096 2009-10-27 19:16 linux-headers-2.6.31-14-generic
drwxr-xr-x 23 root root 4096 2009-12-11 16:57 linux-headers-2.6.31-16
drwxr-xr-x 7 root root 4096 2009-12-11 16:57 linux-headers-2.6.31-16-generic
-rw-r–r– 1 root src 6319116 2009-12-11 19:51 linux-headers-2.6.31.4-custom_2.6.31.4-custom-10.00.Custom_amd64.deb
-rw-r–r– 1 root src 403726102 2009-12-11 19:48 linux-image-2.6.31.4-custom_2.6.31.4-custom-10.00.Custom_amd64.deb
drwxr-xr-x 26 root root 4096 2009-12-11 19:48 linux-source-2.6.31
-rw-r–r– 1 root root 62176632 2009-12-08 09:02 linux-source-2.6.31.tar.bz2
root@falko-desktop:/usr/src#
向下面这样安装这两个包…
dpkg -i linux-image-2.6.31.4-custom_2.6.31.4-custom-10.00.Custom_amd64.deb linux-headers-2.6.31.4-custom_2.6.31.4-custom-10.00.Custom_amd64.deb
… 再重启系统:
reboot
然后, 作为一个普通用户运行
uname -a
… , 你就可以看到你的新内核了:
falko@falko-desktop:~$ uname -a
Linux falko-desktop 2.6.31.4-custom #1 SMP Fri Dec 11 17:36:56 CET 2009 x86_64 GNU/Linux
falko@falko-desktop:~$
现在我们可以继续 VMware Server 的安装:
cd /home/falko/Downloads/vmware-update*/
sudo ./runme.pl
这一回下面这个问题可以回答yes:
Before running VMware for the first time after update, you need to configure it
for your running kernel by invoking the following command:
“/usr/bin/vmware-config.pl”. Do you want this script to invoke the command for
you now? [no]
以后的问题你可以简单敲击 来接受默认值.
当安装程序询问这个时:
In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines]
你既可以接受默认值,也可以指定一个有充足空间来存放你的虚拟机的地方.
在安装即将结束的时候会要求你输入序列号:
Please enter your 20-character serial number.
Type XXXXX-XXXXX-XXXXX-XXXXX or ‘Enter’ to cancel:
填入你的VMware Server序列号.
成功安装以后,你可以删除VMware Server的下载文件和安装目录:
cd /home/falko/Downloads
rm -f VMware-server*
rm -fr vmware-server-distrib/
rm -fr vmware-update*
你可以在这个地方找到VMware Server: Applications > Other > VMware Server Console:
启动的时候选择 Local host:
接下来你就可以创建虚拟机了 (或者导入你用 VMware Converter创建的Windows虚拟机):
链接
Ubuntu: http://www.ubuntu.com/
VMware Server 1.0.x: http://downloads.vmware.com/d/info/datacenter_downloads/vmware_server/1_0