Chinaunix首页 | 论坛 | 博客
  • 博客访问: 301092
  • 博文数量: 56
  • 博客积分: 3056
  • 博客等级: 中校
  • 技术积分: 662
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 12:37
个人简介

一不小心出了国

文章分类

全部博文(56)

文章存档

2015年(1)

2011年(1)

2010年(1)

2009年(5)

2008年(14)

2007年(34)

我的朋友

分类: LINUX

2007-09-03 12:36:10

    linux下有很多种虚拟机软件,但是在windows习惯了用VMware,操作比较简单,于是在linux下不妨也用用看,于是到VMware的官网()上下来一个最新的VMware-server-1.0.3-44356.tar.gz(vmwar for linux),通过几步简单的表单填写就可以申请个免费的注册码,本地解压后执行里面的vmware-install.pl脚本基本一路按默认回车下去即可,安装完毕需要给虚拟机的安装目录可读写权限,默认位置是/var/lib/vmware/,接下来就是涉及到具体操作了,最简单的方法是下载一个相同版本的windows版本,然后从windows下远程链接过去就和本机操作一样了,本人由于是在美国的服务器上安装,只好在本地windows下先安装好(虚拟机安装好的系统文件在windows下与linux通用),然后将文件打包上传,然后用命令:vmware-cmd -s regeister /var/lib/vmware/Virtual\ Machines/CentOS\ X86/Red\ Hat\ Enterprise\ Linux\ 4.vmx 先注册,再用vmware-cmd /var/lib/vmware/Virtual\ Machines/CentOS\ X86/Red\ Hat\ Enterprise\ Linux\ 4.vmx start 启动。这里本人遇到个问题,我们美国服务器是64位的机子,第一次上传本地安装好的64位系统居然启动不了,报错不支持64位,于是再上传个32位的即可,具体原因还不祥。这样虚拟机起来后就和真实机一样使用了!
 
 
相关参考:
Linux下安装VMware-gsx-3.2.1
来自:
Vmware-gsx-3.2.1-19281.tar.gz
# tar -zxvf VMware-gsx-3.2.1-19281.tar.gz
2.进入安装目录
# cd vmware-gsx-distrib
3.执行安装程序
./vmware-install.pl
4.安装过程
安装过程中需要输入序列号
Serial: X8TA5-HDWDD-V7H4D-4FUGQ
安装过程比较简单,可以一路回车
一直到最后安装完毕
5。在其他机器上启动VMware virtual machine console
选择remote host
host name: 192.168.1.20
user anme: root
password: password
连接以后,可以按照windows上使用vmware的方法来创建和使用虚拟机

6。创建完windows虚拟机并安装好操作系统后,可以用
菜单VM > install vmware tool... 来安装显卡驱动

7。vmware的启动关闭可以用一下命令
# service vmware start
# service vmware stop

8.启动虚拟机用以下命令
启动虚拟机
vmware-cmd /var/lib/vmware/Virtual\ Machines/Windows2003/winNetEnterprise.vmx start
关闭虚拟机
vmware-cmd /var/lib/vmware/Virtual\ Machines/Windows2003/winNetEnterprise.vmx stop


================================
vmware 命令
vmnet-bridge vmstat vmware-config.pl vmware-smbd
vmnet-dhcpd vm-support vmware-loop vmware-smbpasswd
vmnet-natd vmware vmware-mount.pl vmware-smbpasswd.bin
vmnet-netifup vmware-authtrusted vmware-nmbd vmware-uninstall.pl
vmnet-sniffer vmware-cmd vmware-ping vmware-vdiskmanager

列出虚拟机
vmware-cmd -l
启动虚拟机
vmware-cmd /var/lib/vmware/Virtual\ Machines/Windows2003/winNetEnterprise.vmx start
关闭虚拟机
vmware-cmd /var/lib/vmware/Virtual\ Machines/Windows2003/winNetEnterprise.vmx stop


vmware-cmd 命令
[ORACLE@test vmware]$ vmware-cmd -h
Usage: /usr/bin/vmware-cmd
/usr/bin/vmware-cmd -s
Options:
Connection Options:
-H specifies an alternative host (if set, -U and -P must als o be set)
-O

specifies an alternative port
-U specifies a user
-P

specifies a password
General Options:
-h More detailed help.
-q Quiet. Minimal output
-v Verbose.
Server Operations:
/usr/bin/vmware-cmd -l
-- lists the registered VMs
/usr/bin/vmware-cmd -s register
-- registers a VM
/usr/bin/vmware-cmd -s unregister
-- unregisters a VM
/usr/bin/vmware-cmd -s getresource
-- retrieves a server resource
/usr/bin/vmware-cmd -s setresource
-- sets a server resource
VM Operations:
/usr/bin/vmware-cmd getconnectedusers
/usr/bin/vmware-cmd getstate
-- gets the execution state of the VM
/usr/bin/vmware-cmd start


-- powers on or resumes a VM
/usr/bin/vmware-cmd stop


-- stops a VM
/usr/bin/vmware-cmd reset


-- resets a VM
/usr/bin/vmware-cmd suspend


-- suspends a VM
/usr/bin/vmware-cmd setconfig
-- sets a configuration variable
/usr/bin/vmware-cmd getconfig
-- retrieves the value for a configuration variable
/usr/bin/vmware-cmd setguestinfo
-- sets a guest info variable
/usr/bin/vmware-cmd getguestinfo
-- retrieves the value for a guest info variable
/usr/bin/vmware-cmd getid
-- retrieves the VM id
/usr/bin/vmware-cmd getpid
-- retrieves the process id of the running VM
/usr/bin/vmware-cmd getproductinfo


-- gets various product information
/usr/bin/vmware-cmd connectdevice
-- connects a virtual device to a VM
/usr/bin/vmware-cmd diSCOnnectdevice
-- disconnects a virtual device from a VM
/usr/bin/vmware-cmd getconfigfile
-- retrieves the path to the configuration file
/usr/bin/vmware-cmd getheartbeat
-- retrieves the heartbeat value of the guest OS
/usr/bin/vmware-cmd getuptime
-- retrieves the uptime of the guest OS
/usr/bin/vmware-cmd getremoteconnections
-- retrieves the number of remote connections to a VM
/usr/bin/vmware-cmd gettoolslastactive
-- retrieves the number of seconds since last notification from the tools
/usr/bin/vmware-cmd getresource
-- retrieves a VM resource
/usr/bin/vmware-cmd setresource
-- sets a VM resource
/usr/bin/vmware-cmd setrunasuser


-- sets the user that the VM runs as
/usr/bin/vmware-cmd getrunasuser
-- retrieves the user that the VM runs as
/usr/bin/vmware-cmd getcapabilities
-- retrieves the access permissions of the current user on a VM
/usr/bin/vmware-cmd addredo
-- adds a redo log to a virtual disk
/usr/bin/vmware-cmd commit
-- commits the redo log of a virtual disk
/usr/bin/vmware-cmd answer
-- answers a question for a VM requesting input
=============================================
Linux下安装和卸载vmware tool
Installing VMware Tools in a Linux or Freebsd Virtual Machine
1. Power on the virtual machine.
2. After the guest operating system has started, prepare your virtual machine to install VMware Tools.
Choose VM > Install VMware Tools.
The remaining steps take place inside the virtual machine.
3. Be sure the guest operating system is running in text mode. You cannot install VMware Tools from a terminal in an X window session.
Some recent distributions of Linux are configured to run the X server when they boot and do not provide an easy way to stop the X server. However, you can switch to a different workspace that is still in text mode and install VMware Tools from that workspace.
To switch between Linux workspaces in a virtual machine, press Ctrl-Alt-Space, release Space without releasing Ctrl and Alt, then press the function key for the workspace you want to use — for example, F2.
Note: If you changed your hot-key combination to something other than Ctrl-Alt, use that combination with Space and the function key.
4. As root (su -), mount the VMware Tools virtual CD-ROM image, change to a working Directory (for example, /tmp), uncompress the installer, then unmount the CD-ROM image.
Note: You do not use an actual CD-ROM to install VMware Tools, nor do you need to download the CD-ROM image or burn a physical CD-ROM of this image file. The GSX Server software contains an ISO image that looks like a CD-ROM to your guest operating system. This image contains all the files needed to install VMware Tools in your guest operating system.
Linux Guests: Some Linux distributions use different device names or organize the /dev directory differently. If your CD-ROM drive is not /dev/cdrom or if the mount point for a CD-ROM is not /mnt/cdrom, modify the following commands to reflect the conventions used by your distribution.
Further, some Linux distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands below. You still must untar the VMware Tools installer to /tmp.
mount /dev/cdrom /mnt/cdrom
cd /tmp
tar zxf /mnt/cdrom/vmware-linux-tools.tar.gz
umount /mnt/cdrom
FreeBSD Guests: Some FreeBSD distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands below. You still must untar the VMware Tools installer to /tmp.
mount /cdrom
cd /tmp
tar zxf /cdrom/vmware-freebsd-tools.tar.gz
umount /cdrom
5. Run the VMware Tools installer.
cd vmware-tools-distrib
./vmware-install.pl
6. Answer the questions about default directories.
7. Run the configuration program.
vmware-config-tools.pl
8. To change your virtual machine's display resolution, answer yes, then enter the number that corresponds to the desired resolution.
9. Log off of the root account.
exit
10. Start X and your graphical environment.
11. In an X terminal, launch the VMware Tools background application.
vmware-toolbox &
You can run VMware Tools as root or as a normal user. To shrink virtual disks, you must run VMware Tools as root (su -).
Note: To get the greatest benefit from the features of VMware Tools, always run vmware-toolbox in the guest operating system.

Uninstalling VMware Tools
If you need to remove VMware Tools from your Linux guest operating system, log on as root (su -) and run the following command:
vmware-uninstall-tools.pl

=======================================================================================
管理接口 management interface
需要下载VMware-mui-3.2.1-19281.tar.gz
windows下运行
C:\Program Files\VMware\VMware Management Interface\htdocs\init.pl
linux下运行
vmware-config-mui.pl


The apache Server and the VMware Management Interface
On GSX Server for Linux hosts, an Apache server is installed with the management interface. Listed here are the commands to start, stop and restart the Apache server.
In order to use these commands, you must first log on as root (su -), then open a terminal session.
To start the Apache server, type
/etc/init.d/httpd.vmware start
To stop the Apache server, type
/etc/init.d/httpd.vmware stop
To restart the Apache server, type
/etc/init.d/httpd.vmware restart

阅读(1361) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~