下载ubuntu-6.06-desktop-i386.iso, 用的VMware.Workstation.v5.5.1.19175, host os: xp chs sp2
用vmware新建一个虚拟机, 选择linux & ubuntu, 一路跟着向导走就ok.
右键点击生成的ubuntu虚拟机, 在设置里把cdrom属性设为使用iso镜像,就是上面下的那个安装iso.
启动虚拟机, 进入启动菜单, F2选择中文, 看起来方便些. 进去之后点桌面上的install开始安装….
ok, 之后安装vmware-tools, 这个比较麻烦, 安装成功的标志是: 无需按 Ctrl-Alt 就可离开VM的窗体, 方便在host和virtual pc间切换.
1.首先要将虚拟机power off. 把刚才设置的cdrom属性中指定的那个iso文件改为vmware安装目录下的linux.iso. 也可以不这么做. 启动虚拟机后选择vmware的菜单vm->install vmtools也会把该iso加载到光驱中的, 达到相同的效果.
2. 如果你用的是前一种方法, 那然后就启动虚拟机, 登录进去. 如果是后一种方法, 那就直接开工. 先做些准备工作,把需要的东西备齐:
a. 把光驱里的VMwareTools-5.0.0-13124.tar.gz(具体文件名跟你用的vm版本有关)文件解压到/tmp
b. 下载附件vmware-tools-any-update1.tar.gz: files/vmware-tools-any-update1.tar_189.tar 解压到/tmp
c. 下载附件patch.tar: files/patch_165.tar 文件解压到/tmp
3. 打开一个终端, 开始敲命令: (#后面是我的注释)
代码: 全选
#切换到root用户
sudo -s -H
#输入密码
#安装linux kernel header和必备的开发环境
apt-get install linux-headers-$(uname -r) build-essential gcc
#此时你的/tmp目录下应该有vmware-tools-distrib、vmware-tools-any-update1这两个目录,还有一个patch.txt文件
#依次运行下面的命令, 当问你是否运行 vmware-config-tools.pl 时回答no
cd /tmp/vmware-tools-distrib
./vmware-install.pl
#依次运行下面的命令, 同样的, 当问你是否运行 vmware-config-tools.pl 时回答no
cd /tmp/vmware-tools-any-update1/
./runme.pl
cd /usr/bin
patch vmware-config-tools.pl /tmp/patch.txt
./vmware-config-tools.pl
#会让你设置屏幕显示大小, 800*600, 1024*768等等.
ctrl+alt+← 重启X, 一切搞定.
注:
1. ubuntu安装做得非常好, 基本上不会有什么问题. 开始安装后把vm最小化, 过会再打开就发现已经装好了. 不需要什么交互. 印象中安装过程中在后面安装软件更新还是什么的时候有个可供选择的按钮, 让你选择"忽略", 这样可能会更快一些. 安装好之后更换对你而言更合适更快速的源后再更新也不迟.
2. vm5对dapper的x支持有些问题, 本文解决了安装vmtools时可能会遇到的 找不到make,gcc, "C header files that match you running kernel ", "no X install found"等错误
3. linux社区的资源非常丰富, 所以遇到问题只要肯找基本上都能找到答案, 在这里要感谢那么多有心人和好心人把自己的经验分享出来. 下面是本文的参考链接:
a.weblog_entry.php?e=458
b.http://www.vmware.com/community/thread. ... 4&tstart=0
c.http://www.clendenen.net/index.php?opti ... &Itemid=28 这个链接的文章里有patch的内容, 可以直接到那里去拷贝然后自己生成patch.txt, 我把它拷下来放这儿吧:
代码: 全选
--- vmware-config-tools.pl.orig 2006-03-27 02:02:17.000000000 -0500
+++ vmware-config-tools.pl 2006-03-27 02:11:46.000000000 -0500
@@ -587,6 +587,10 @@
my $gXVideoDriverFile = '';
my $gIs64BitX = 0;
+# The location of the modules dir has changed in X.org 7
+my $cXModulesDir7 = '/usr/lib/xorg/modules';
+my $cX64ModulesDir7 = '/usr/lib64/xorg/modules';
+
# Load the installer database
sub db_load {
undef %gDBAnswer;
@@ -3874,6 +3878,10 @@
return '/usr/X11R6/bin';
}
+sub xserver7 {
+ return '/usr/bin/X';
+}
+
sub xserver6 {
return xserver_bin() . '/Xorg';
}
@@ -4029,6 +4037,8 @@
$x_server_file = xserver4();
} elsif ($x_version == 6) {
$x_server_file = xserver6();
+ } elsif ($x_version == 7) {
+ $x_server_file = xserver7();
}
$x_server_file_name = internal_basename($x_server_file);
@@ -4075,6 +4085,86 @@
set_uid_X_server($x_server_file);
}
+sub xorg_7 {
+ my $xconfig_path = '/etc/X11';
+ my $xconfig_file_name = 'xorg.conf';
+ my $xversion = 7;
+ my $xversionAll = '';
+ my $xserver_link = '';
+ my $major;
+ my $minor;
+ my $sub;
+
+ $xversionAll = direct_command(shell_string(xserver7()) . ' -version 2>&1') =~
+ /X Protocol Version 11.* Release (\d+\.\d+)/ ? $1 : '0.0.0';
+
+ if (defined $ENV{'XORGCONFIG'} && file_name_exist('/etc/X11/' .
+ $ENV{'XORGCONFIG'})) {
+ $xconfig_path = '/etc/X11';
+ $xconfig_file_name = $ENV{'XORGCONFIG'};
+ } elsif (defined $ENV{'XORGCONFIG'} &&
+ file_name_exist('/usr/X11R6/etc/X11/' . $ENV{'XORGCONFIG'})) {
+ $xconfig_path = '/usr/X11R6/etc/X11';
+ $xconfig_file_name = $ENV{'XORGCONFIG'};
+ } elsif (file_name_exist('/etc/X11/xorg.conf-4')) {
+ $xconfig_path = '/etc/X11';
+ $xconfig_file_name = 'xorg.conf-4';
+ } elsif (file_name_exist('/etc/X11/xorg.conf')) {
+ $xconfig_path = '/etc/X11';
+ $xconfig_file_name = 'xorg.conf';
+ } elsif (file_name_exist('/etc/xorg.conf')) {
+ $xconfig_path = '/etc';
+ $xconfig_file_name = 'xorg.conf';
+ } elsif (file_name_exist('/usr/X11R6/etc/X11/xorg.conf-4')) {
+ $xconfig_path = '/usr/X11R6/etc/X11';
+ $xconfig_file_name = 'xorg.conf-4';
+ } elsif (file_name_exist('/usr/X11R6/etc/X11/xorg.conf')) {
+ $xconfig_path = '/usr/X11R6/etc/X11';
+ $xconfig_file_name = 'xorg.conf';
+ } elsif (file_name_exist('/usr/X11R6/lib/X11/xorg.conf-4')) {
+ $xconfig_path = '/usr/X11R6/lib/X11';
+ $xconfig_file_name = 'xorg.conf-4';
+ } elsif (file_name_exist('/usr/X11R6/lib/X11/xorg.conf')) {
+ $xconfig_path = '/usr/X11R6/lib/X11';
+ $xconfig_file_name = 'xorg.conf';
+ }
+
+ print wrap("\n\n" . 'Detected X.org version ' . $xversionAll . '.'
+ . "\n\n", 0);
+
+ ($major, $minor, $sub) = split_X_version($xversionAll);
+
+ # If there is an existing driver, replace it by ours.
+ if ($major == 7) {
+
+ backup_file_to_restore($gXVideoDriverFile, 'OLD_X4_DRV');
+ if (file_name_exist($gXVideoDriverFile)) {
+ unlink $gXVideoDriverFile;
+ }
+
+ # Install the drivers.
+ my %p;
+ undef %p;
+ if ($minor == 0) {
+ # This is the best driver we can install for X.org 7.0.0
+ install_file(db_get_answer('LIBDIR') . '/configurator/XOrg/6.8.x' .
+ ($gIs64BitX ? '_64' : '') . '/vmware_drv.o',
+ $gXVideoDriverFile, \%p, 1);
+ install_file(db_get_answer('LIBDIR') . '/configurator/XOrg/6.8.x' .
+ ($gIs64BitX ? '_64' : '') . '/vmmouse_drv.o',
+ $gXMouseDriverFile, \%p, 1);
+ } else {
+ print wrap("\n\n" . 'No mouse driver for X.org version: ' . $xversionAll . '.'
+ . "\n\n", 0);
+ }
+ fix_X_link('7');
+ } else {
+ error ('Problem extracting verion of X.org' . "\n\n");
+ }
+ return ($xversion, xconfig_file_abs_path($xconfig_path, $xconfig_file_name),
+ $xversionAll);
+}
+
sub xorg_6 {
my $xconfig_path = '/etc/X11';
my $xconfig_file_name = 'xorg.conf';
@@ -4934,7 +5024,23 @@
my $xconfig_backup = '';
my $createNewXConf = 0;
- if (file_name_exist(xserver6())) {
+ if (file_name_exist(xserver7())) {
+ if (is64BitElf(xserver7())) {
+ $gIs64BitX = 1;
+ # 64-bit FreeBSD puts it's 64-bit X modules in lib not lib64
+ if (vmware_product() ne 'tools-for-freebsd') {
+ $gXMouseDriverFile = "$cX64ModulesDir7/input/vmmouse_drv.o";
+ $gXVideoDriverFile = "$cX64ModulesDir7/drivers/vmware_drv.o";
+ } else {
+ $gXMouseDriverFile = "$cXModulesDir7/input/vmmouse_drv.o";
+ $gXVideoDriverFile = "$cXModulesDir7/drivers/vmware_drv.o";
+ }
+ } else {
+ $gXMouseDriverFile = "$cXModulesDir7/input/vmmouse_drv.o";
+ $gXVideoDriverFile = "$cXModulesDir7/drivers/vmware_drv.o";
+ }
+ ($xversion, $xconfig_file, $xversionAll) = xorg_7();
+ } elsif (file_name_exist(xserver6())) {
if (is64BitElf(xserver6())) {
$gIs64BitX = 1;
# 64-bit FreeBSD puts it's 64-bit X modules in lib not lib64