xp系統下的虛擬機中安裝了linux後,虛擬機VMware中的linux界面太小,是由於
linux分辨率太低(通常為800×600)造成的,可以通過安裝VMware Tools來更改分
辨率到1024×768來解決這個問題,下面說明安裝VMware Tools並配置分辨率的
步驟:
1.安裝工具。讓虛擬機運行於窗口狀態,不要全屏,按Ctrl+Alt讓鼠標釋放出來。在VMware的菜單欄上選擇"虛擬機/安裝虛擬機工具(VM/Install VMware Tools...)"。然後切換到客戶操作系統,即Linux。
2.掛載光盤。
# mount /dev/cdrom /mnt/cdrom
3.執行命令。進入虛擬光盤,可以看到有兩個文件,壹個是壓縮包,壹個為rpm包。直接運行rpm包安裝,命令行也可。rpm -Uvh VMwareTools-版本號-版本號.i386.rpm
# cd /mnt/cdrom
# ls -l
有兩上文件 :
VMwareTools-5.5.1-19175.i386.rpm
VMwareTools-5.5.1-19175.tar.gz
並把這兩個文件拷貝到妳的文件下 如 /tmp
#cp VMwareTools-5.5.1-19175.tar.gz /tmp
#cp VMwareTools-5.5.1-19175.i386.rpm /tmp
#cd /tmp
#rpm -ivh VMwareTools-5.5.1-19175.i386.rpm
4.上述操作完成後,進入/usr/bin目錄,查找vmware-config-tools.pl.找到後,運行它。
5.壹路回車
6.
#tar -xzvf VMwareTools-5.5.1-19175.tar.gz
#cd vmware-tools-distrib
#./vmware-install.pl
Creating a new installer database using the tar3 format.
Installing the content of the package.
# 安裝過程的畫面,全部使用默認值,壹直按 Enter 就對了
In which directory do you want to install the binary files?
[/usr/bin]
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]
What is the directory that contains the init scripts?
[/etc/rc.d/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
Thepath "/usr/lib/vmware-tools" does not exist currently. This program isgoingto create it, including needed parent directories. Is this whatyou want?
[yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
Thepath "/usr/share/doc/vmware-tools" does not exist currently. Thisprogram isgoing to create it, including needed parent directories. Isthis what you want?
[yes]
The installation of VMware Tools 5.5.1 build-19175 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ 確定 ]
Trying to find a suitable vmhgfs module for your running kernel.
The module bld-2.6.9-5.EL-i686-RHEL4 loads perfectly in the running kernel.
pcnet32 30153 0
Unloading pcnet32 module
Trying to find a suitable vmxnet module for your running kernel.
The module bld-2.6.9-5.EL-i686-RHEL4 loads perfectly in the running kernel.
Detected X.org version 6.8.
關閉控制臺鼠標服務: [ 確定 ]
啟動控制臺鼠標服務: [ 確定 ]
Please choose one of the following display sizes (1 - 13):
# 顯示分辨率,這裏是以 1024x768 為例
# VMware Tools 安裝的時候,會自動修改 X server 的配置文件
[1] "640x480"
[2]< "800x600"
[3] "1024x768"
[4] "1152x864"
[5] "1280x800"
[6] "1152x900"
[7] "1280x1024"
[8] "1376x1032"
[9] "1400x1050"
[10] "1680x1050"
[11] "1600x1200"
[12] "1920x1200"
[13] "2364x1773"
Please enter a number between 1 and 13:
[2] 3
X Window System Version 6.8.2
Release Date: 9 February 2005
X Protocol Version 11, Revision 0, Release 6.8.2
Build Operating System: Linux 2.6.9-34.EL i686 [ELF]
Current Operating System: Linux rd01.domain 2.6.9-34.EL #1 Wed Mar 8 00:07:35 CST 2006 i686
Build Date: 04 May 2006
Build Host: x8664-build.centos.org
Before reporting problems, check et32
rmmod vmxnet
depmod -a
modprobe vmxnet
/etc/init.d/network start
Enjoy,
--the VMware team
# shutdown -r now
# 修改完成之後,重新啟動計算機,讓 VMware Tools 生效
在\etc 目錄下找到inittab文件VI 它,找到id:5:initdefault:改成id:3:initdefault: 這裏5代表圖形界面 3代表命令行的界面
按照Readme中的安裝方法,壹步步按照默認的設置下來,出現如下錯誤:
What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]The directory
of kernel headers (version 2.6.18-8.el5xen) does not match.
可以使用
[root@localhost ~]# uname -r // 查看內核版本號
查看目錄/usr/src/ 根本沒有linux這個目錄
在網上收到資料:沒有安裝 kernel-xen-devel rpm包,在安裝盤中找到這個rpm包:kernel-xen-devel-2.6.18-8.el5.i686.rpm
安裝:
[root@localhost ~]# rpm -ivh kernel-xen-devel-2.6.18-8.el5.i686.rpm
再使用vmware-install.pl安裝,即可自動找到配套的the directory of C header files
註重,網上還有人說需要安裝的rpm包是kernel-devel,經過測試,安裝kernel-devel-2.6.18-8.el5.i686.rpm包後依然無法自動找到the
directory of C header files,假如手動改目錄為:/usr/src/kernels/2.6.18-8.e15-i686/include,會出現錯誤:
The directory of kernel headers (version 2.6.18-8.el5) does not match your running kernel (version 2.6.18-8.el5xen). Even if
the module were tocompile successfully, it would not load into the running kernel.
這就是安裝的rpm不正確導致的。
安裝好kernel-xen-devel-2.6.18-8.el5.i686.rpm包後,這樣就壹直enter,裝完VMware Tools
在安裝的最後階段,會出現:
Do you want to change your guest X resolution? (yes/no) [no] y
Please choose one of the following display sizes (1 - 13):
[1] "640x480"
[2]< "800x600"
[3] "1024x768"
[4] "1152x864"
[5] "1280x800"
[6] "1152x900"
[7] "1280x1024"
[8] "1376x1032"
[9] "1400x1050"
[10] "1680x1050"
[11] "1600x1200"
[12] "1920x1200"
[13] "2364x1773"
Please enter a number between 1 and 13:
[3]
到了這步,千萬別重啟看效果,還要修改xorg config設置,不然重啟後會報X-WINDOWS出錯。
進入/etc/X11/,用文本打開xorg.conf,加上以下幾段:
Section "Monitor"
Identifier "vmware"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "vmmouse"
Option "Protocol" "Auto"
Option "Device" "/dev/input/mouse0"
EndSection
然後找到 含有"ServerLayout" 的section, 在Section跟EndSection之間加上以下壹行。
InputDevice "Mouse0" "CorePointer"
終於大功告成,重啟看看效果了
重啟之後,resolution不知道為何並沒有變化,有待進壹步研究,但是Mouse移進移出VMware可以不用再使用Ctrl+Alt鍵了