And*_*een 12 command-line windows virtualbox scripts launcher
我想在 Ubuntu 中编写一个执行以下操作的 shell 脚本:
在 Virtualbox 中启动 Windows 7 来宾操作系统(如果它尚未运行)。
在 Windows 中运行 shell 脚本,其中 shell 脚本是从 Ubuntu 主机操作系统调用的。
我的目标是在 Ubuntu 主机桌面上为来宾操作系统上的应用程序创建一个应用程序启动器。例如,我可以在 Ubuntu 桌面上为 Visual Studio 创建一个快捷方式,以在 Windows 中启动 Visual Studio。我一直希望能够直接从 Ubuntu 桌面启动 Windows 应用程序,而不是在单击应用程序快捷方式之前等待 Windows 启动。
Tak*_*kat 16
Windows 来宾有一些限制,但要从可以放在启动器中的脚本以无缝模式运行来宾应用程序,我们测试了以下过程:
现在我们可以使用以下命令获得对虚拟机的完全命令行控制:
从无缝保存状态启动虚拟机
VBoxManage startvm "<Name_of_VM>"
Run Code Online (Sandbox Code Playgroud)
或(对于 Qt 前端)
VirtualBox --startvm "<Name_of_VM>"
Run Code Online (Sandbox Code Playgroud)在 VM 中运行应用程序
VBoxManage --nologo guestcontrol "<Name_of_VM>" run --exe "C:\\full\\path\\to\\program.exe" --username windowsuser --password password --wait-stdout
Run Code Online (Sandbox Code Playgroud)以保存状态终止 VM
VBoxManage controlvm "Name_of_VM" savestate
Run Code Online (Sandbox Code Playgroud)将这些放在脚本中,以在您的 Ubuntu 桌面上享受无缝的 Windows 应用程序窗口。
如果您设置了无密码 Windows 登录,这将不起作用。有关限制以及如何配置 Windows 以使其正常工作,请参阅Virtual Box 手册。
此外,要使用没有或有空密码的帐户,必须更改来宾的组策略。为此,请在命令行上键入gpedit.msc打开组策略编辑器,打开密钥
Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options并将值更改Accounts: Limit local account use of blank passwords to console logon only为禁用。
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\limitblankpassworduse根据此答案,在没有组策略编辑器 (gpedit.msc) 的操作系统上,例如 Windows 的家庭版,在注册表项处创建一个 DWORD并将其设置为零将达到相同的效果。
| 归档时间: |
|
| 查看次数: |
18083 次 |
| 最近记录: |