在我的特殊情况下,随着Ubuntu18.04仿生和VirtualBox-5.2.20的新服务器安装,自动启动客人的旧方法似乎不再可用。并不是说它有那么美妙--但它起了作用。在这方面似乎没有任何明确的方法--系统和VirtualBox如何协同工作以实现智能引导、控制和关闭?
发布于 2019-09-07 11:53:34
类似于您的解决方案,但稍微简单一点:
systemctl edit vbox@.service --full --force并粘贴以下内容,将用户和组更新到您的用户名。[Unit]
Description=Virtual Box Guest %I
After=network.target vboxdrv.service
Before=runlevel2.target shutdown.target
[Service]
User=USERNAME
Group=GROUPNAME
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/usr/bin/VBoxManage startvm %i --type headless
ExecStop=/usr/bin/VBoxManage controlvm %i acpipowerbutton
[Install]
WantedBy=multi-user.targetsystemctl daemon-reloadVBoxManage list vms列表:$ VBoxManage list vms
"Ubuntu" {1ba32309-d4c4-420a-a9c8-a38177f00bc4}
"Windows" {573df054-0e33-4389-896a-1234f10e25ad}sudo systemctl start vbox@Ubuntu # Start the VM
sudo systemctl enable vbox@Ubuntu # Start the VM on boothttps://serverfault.com/questions/939078
复制相似问题