查看所有包含 VMware 标签的文章
十月
21

VMware Workstation 自动启动服务、网卡和启动程序批处理脚本

Author Dominic    Category 软件应用     Tags

有些时候我们需要使用 Workstation 来运行虚拟机,但是 Workstation比较讨厌的地方是启动了三个服务而且还是自动,并且添加了两个网卡,对于偶尔使用的人来说,且不说他们对系统造成的影响,这些程序有碍观瞻。我采取平时禁用的服务和网卡,需要的时候再启用它,手工操作比较麻烦,于是写了以下批处理命令:

echo "开始启动网卡和服务" netsh interface set interface VMnet8 enabled net start VMAuthdService net start VMnetDHCP net start " NAT Service" net start VMUSBArbService echo "程序启动后不要关闭本窗口" d: cd "D:\Program Files\\ Workstation" "D:\Program Files\\ Workstation\.exe" echo "开始关闭启动网卡和服务" netsh interface set interface VMnet8 disabled net stop VMUSBArbService net stop " NAT Service" net stop VMnetDHCP net stop VMAuthdService

将这个脚本保存为.bat,保存到 Workstation的目录(我安装在”D:\Program Files\\ Workstation”,不是这个目录请调整批处理中的目录和盘符),打开网络连接,重命名新建的两个网络连接为VMnet1和VMnet8(如果不重命名需要更改批处理中的网卡名称),并禁用这两个网络连接。打开服务管理器,将开头的5个服务全部改成手动。然后更改桌面的 Workstation快捷方式,让快捷方式指向.bat批处理文件,如果是Vista或者Windows 7 需要勾选采用管理员身份运行。

双击桌面 Workstation图标即可顺利启动服务、网卡和 Workstation程序,如果不关闭命令窗口,在退出 Workstation程序之后会自动禁用网卡和停止相关服务。

另外如果 Workstation中采用的不是NAT网络(即使用vmnet8),也需要更改批处理中的网络接口名称。

六月
16

解决VMware Tools没有自动启动的问题

装好了 9.04,并编译安装好之后,重新登录结果竟然没有自动启动,使用ps –A | grep 命令竟然就看到一个-guested进程,没有-user进程,根据网上的方法,在首选项->启动程序手工添加了-user启动项,重新退出登录,结果-user还是没有自动启动。

查看系统日志发现以下信息:

Jun 16 17:02:29  x-session-manager[3367]: WARNING: Could not parse desktop file /usr/share/gnome/autostart/-user.desktop: 键文件没有键“Type”
Jun 16 17:02:29  x-session-manager[3367]: WARNING: could not read /usr/share/gnome/autostart/-user.desktop
Jun 16 17:02:30  x-session-manager[3367]: WARNING: Could not parse desktop file /etc/xdg/autostart/-user.desktop: 键文件没有键“Type”
Jun 16 17:02:30  x-session-manager[3367]: WARNING: could not read /etc/xdg/autostart/-user.desktop 

给/usr/share/gnome/autostart/-user.desktop 加上可写权限之后,打开发现内容如下:

[Desktop Entry]
Encoding=UTF-8
Exec=-user
Name= User Agent
X-KDE-autostart-phase=1
NoDisplay=true

Google一番之后发现更改成以下内容:

[Desktop Entry]
Type=Application
Name= User Agent
Exec=-user
Icon=system-run
Comment= User Agent
X-GNOME-Autostart-enabled=true

再次退出登录即可发现-user自动启动了,自动适应 workstation窗口大小了。

六月
1

Ubuntu 9.04安装VMWare Tools

Author Dominic    Category 软件应用     Tags , ,

测试需要,这次在 Workstation 6.5.2下安装了 9.04版,语言选择的是简体中文,安装完毕之后完成自动升级,结果发现 Tools好像没有装好,鼠标不能自动移出控制台。决定重新安装一下 Tools。谁知道从光盘拷贝文件解压之后竟然没有顺利安装,报错如下:

Using compiler “/usr/bin/gcc”. Use environment variable CC to override.

Your compiler “/usr/bin/gcc” version “gcc 版本 4.3.3 ( 4.3.3-5ubuntu4)
” is not supported by this version of Tools.

The memory manager driver (vmmemctl module) is used by host software to
efficiently reclaim memory from a virtual machine.
If the driver is not available, host software may instead need to swap
guest memory to disk, which may reduce performance.
The rest of the software provided by Tools is designed to work
independently of this feature.
If you want the memory management feature, you can install the driver by
running -config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution’s installation CD.
[ Press Enter key to continue ]

郁闷坏了,经过调试发现这个破 Tools在获取gcc版本信息时是解析“gcc version …”,而且必须是英语的version,偏偏中文版把这个也翻译了。解决办吧就是更改的系统语言为English。通过菜单系统->系统管理->语言支持,把默认语言改成English(United States),退出之后再次登录,重新安装即可顺利通过安装。

但是在进入到-config-tools.pl这一步时却又报错。说是__grab_cache_page函数重定义了。现在都是最大的虚拟化供应商怎么犯这个错误了。解决办法是进入/usr/lib/-tools/modules/source目录解压vmhgfs.tar中的page.c,并编辑page.c中的867行修改为

page = grab_cache_page(mapping, index);

重新运行-config-tools.pl即可。

专题推荐

标签

404错误 apache article CSS dotNet fckeditor Hack iOS iTouch javascript PayPal PHP rar ubuntu utf8 VMware VMware Tools weblinks Win2008 Windows Server 2008 Wordpress xajax XOOPS 上传 个人 中文 中文习惯 关键词 合肥 域名 安全 工作 文件类型 文章管理 时区 未分类 模块 模板 模组 电子地图 界面友好 禅意花园 网速 腾讯 配置管理

分类目录

新浪微博

存档

最近文章

近期评论

友情链接

分享按钮