1. 首先在“我的电脑”-“属性”-“高级”-“环境变量”-“PATH”中添加vmware路径,如:C:\Program Files (x86)\VMware\VMware Workstation
2. 新建一个“启动vmware.bat”文件,输入如下批处理:
@echo off
vmrun.exe -T ws start "你的
虚拟机.vmx文件路径" nogui
3. 保存, 运行该批处理, 如果该虚拟机没有启动, 则可以在后台启动, nogui参数表示不显示界面, 如果想显示界面可以改为gui.
附vmrun命令大全:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
vmrun
1.13
.
1
1379776
Usage:
AUTHENTICATION-FLAGS
--------------------
These
-h <hostName> (not needed
for
-P <hostPort> (not needed
for
-T <hostType> (ws|server|server1|fusion|esx|vc|player)
for
'-T server'
for
Server
2.0
use
'-T server1'
for
Server
1.0
use
'-T ws'
for
VMware Workstation
use
'-T ws-shared'
for
VMware Workstation (shared mode)
use
'-T esx'
for
VMware ESX
use
'-T vc'
for
VMware vCenter Server
-u <userName in host OS> (not needed
for
-p <password in host OS> (not needed
for
-vp <password
for
-gu <userName in guest OS>
-gp <password in guest OS>
POWER
--------------
start
[gui|nogui]
stop
[hard|soft]
reset
[hard|soft]
suspend
[hard|soft]
pause
unpause
SNAPSHOT
-----------------
listSnapshots
[showTree]
snapshot
Snapshot name
deleteSnapshot
Snapshot name
[andDeleteChildren]
revertToSnapshot
Snapshot name
GUEST
-----------------
runProgramInGuest
[-noWait]
[-activeWindow]
[-interactive]
Complete-Path-To-Program
[Program arguments]
fileExistsInGuest
if
Path to file in guest
directoryExistsInGuest
if
Path to directory in guest
setSharedFolderState
Share name
Host path
writable | readonly
addSharedFolder
Share name
New host path
removeSharedFolder
Share name
enableSharedFolders
[runtime]
disableSharedFolders
[runtime]
listProcessesInGuest
killProcessInGuest
process id
runScriptInGuest
[-noWait]
[-activeWindow]
[-interactive]
Interpreter path
Script text
deleteFileInGuest
Path
createDirectoryInGuest
Directory
deleteDirectoryInGuest
Directory
CreateTempfileInGuest
listDirectoryInGuest
Directory path in guest
CopyFileFromHostToGuest
Path
CopyFileFromGuestToHost
Path
renameFileInGuest
Original name
New name
captureScreen
Path
writeVariable
[runtimeConfig|guestEnv|guestVar]
variable name
variable value
readVariable
[runtimeConfig|guestEnv|guestVar]
variable name
getGuestIPAddress
[-wait]
VPROBE
---------------
vprobeVersion
vprobeLoad
'VP script text'
vprobeLoadFile
Path to VP file
vprobeReset
vprobeListProbes
vprobeListGlobals
GENERAL
----------------
list
upgradevm
installTools
checkToolsState
register
unregister
listRegisteredVM
deleteVM
clone
Path to destination vmx file
full|linked
[-snapshot=Snapshot Name]
[-cloneName=Name]
Examples:
Starting
vmrun -T ws start
"c:\my VMs\myVM.vmx"
Stopping
vmrun -T esx -h https:
//myHost.com/sdk -u hostUser -p hostPassword stop "[storage1] vm/myVM.vmx"
Running
vmrun -T ws -gu guestUser -gp guestPassword runProgramInGuest
"c:\my VMs\myVM.vmx"
"c:\Program Files\myProgram.exe"
Running
vmrun -T server -h https:
//myHost.com:8333/sdk -u hostUser -p hostPassword -gu guestUser -gp guestPassword runProgramInGuest "[standard] vm/myVM.vmx" /usr/bin/X11/xclock -display :0
Creating
vmrun -T ws snapshot
"c:\my VMs\myVM.vmx"
mySnapshot
Reverting
vmrun -T ws revertToSnapshot
"c:\my VMs\myVM.vmx"
mySnapshot
Deleting
vmrun -T ws deleteSnapshot
"c:\my VMs\myVM.vmx"
mySnapshot
Enabling
vmrun -T ws enableSharedFolders
"c:\my VMs\myVM.vmx"
|