博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vmware vmrun命令简介
阅读量:4187 次
发布时间:2019-05-26

本文共 2643 字,大约阅读时间需要 8 分钟。

1、简介

       VMWare提供了vmrun与VIX API两种手段使用户可以通过程序对虚拟机进行控制。vmrun是一种命令行控制的手段,但是可以通过Shell脚本实现连续多个操作的自动化。

2、语法

Usage: vmrun COMMAND [PARAMETERS]

Authentication flags
-gu <userName in guest OS>
-gp <password in guest OS>
POWER COMMANDS           PARAMETERS           DESCRIPTION
start                    Path to vmx file     Start a VM or Team
                         or vmtm file
                         [gui|nogui]
stop                     Path to vmx file     Stop a VM or Team
                         or vmtm file
                         [hard|soft]
reset                    Path to vmx file     Reset a VM or Team
                         or vmtm file
                         [hard|soft]
suspend                  Path to vmx file     Suspend a VM or Team
                         or vmtm file
                         [hard|soft]
SNAPSHOT COMMANDS        PARAMETERS           DESCRIPTION
listSnapshots            Path to vmx file     List all snapshots in a VM
snapshot                 Path to vmx file     Create a snapshot of a VM
                         Snapshot name
deleteSnapshot           Path to vmx file     Remove a snapshot from a VM
                         Snapshot name
revertToSnapshot         Path to vmx file     Set VM state to a snapshot
                         Snapshot name
GUEST OS COMMANDS        PARAMETERS           DESCRIPTION
runProgramInGuest        Path to vmx file     Run a program in Guest OS
                         Program
                         [Program arguments]
fileExistsInGuest        Path to vmx file     Check if a file exists in Guest OS
                         Path to file in guest
setSharedFolderState     Path to vmx file     Modify a Host-Guest shared folder
                         Share name
                         New host path
addSharedFolder          Path to vmx file     Add a Host-Guest shared folder
                         Share name
                         Host path
removeSharedFolder       Path to vmx file     Remove a Host-Guest shared folder
                         Share name
listProcessesInGuest     Path to vmx file     List running processes in Guest OS
killProcessInGuest       Path to vmx file     Kill a process in Guest OS
                         process id
runScriptInGuest         Path to vmx file     Run a script in Guest OS
                         Interpreter path
                         script_text
deleteFileInGuest        Path to vmx file     Delete a file in Guest OS
                         File
createDirectoryInGuest   Path to vmx file     Create a directory in Guest OS
                         Directory path
deleteDirectoryInGuest   Path to vmx file     Delete a directory in Guest OS
                         Directory path
listDirectoryInGuest     Path to vmx file     List a directory in Guest OS
                         Directory path
copyFileFromHostToGuest  Path to vmx file     Copy a file from host OS to guest OS
                         Path on host
                         Path in guest
copyFileFromGuestToHost  Path to vmx file     Copy a file from guest OS to host OS
                         Path in guest
                         Path on host
renameFileInGuest        Path to vmx file     Rename a file in Guest OS
                         Original name
                         New name
GENERAL COMMANDS         PARAMETERS           DESCRIPTION
list                                          List all running VMs
upgradevm                Path to vmx file     Upgrade VM file format, virtual hw
installtools             Path to vmx file     Install Tools in Guest OS

3、示例

        1)开启虚拟机

        vmrun start "/opt/VM_OS/RH_OS_B/Red Hat Enterprise Linux 5 64-bit.vmx" nogui|gui

        2)停止虚拟机

        vmrun stop "/opt/VM_OS/RH_OS_B/Red Hat Enterprise Linux 5 64-bit.vmx" nogui|gui

        3)重启虚拟机

        vmrun restart "/opt/VM_OS/RH_OS_B/Red Hat Enterprise Linux 5 64-bit.vmx" nogui|gui

       4)列出正在运行的虚拟机

        vmrun list

转载地址:http://vgdoi.baihongyu.com/

你可能感兴趣的文章
Git标签管理
查看>>
MySQL数据表操作
查看>>
iTerm2 设置字体(Mac OS X)
查看>>
Git变更远程仓库地址
查看>>
Linux touch命令:创建文件
查看>>
Python list extend()方法
查看>>
多项式相加(Python实现)
查看>>
匹配微博转发关系(Python)
查看>>
Git显示或关闭颜色
查看>>
Go println函数:将数据打印到控制台
查看>>
Linux cp命令:复制文件或目录
查看>>
Python装饰器
查看>>
mac安装RabbitMQ
查看>>
CentOS7安装httpd
查看>>
Git忽略特殊文件:.gitignore
查看>>
Go 检测密码强度(密码安全性)
查看>>
设置Linux主机免密认证
查看>>
Python list insert方法
查看>>
快速排序(Python实现)
查看>>
Python实现单向链表
查看>>