码迷,mamicode.com
首页 > 系统相关 > 详细

在Mac上自动启动VirutalBox中的虚拟机 (Auto start VirtualBox VM in mac OSX)

时间:2020-03-24 12:39:53      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:any   shutdown   启动   pre   box   before   nts   default   das   

 Auto start VM in mac OSX(10.15)

    1. Install VirtualBox(6.1.4)
    
    2. Copy file "/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist" to "/Library/LaunchDaemons"
    
    3. Edit the file "/Library/LanchDaemons/org.virtualbox.vboxautostart.plist"
       before

<key>Disabled</key> 

        after:

<key>Enabled</key>

   
    4. Create one file /etc/vbox/autostart.cfg with following content
      

    # Default policy is to deny starting a VM, the other option is "allow".
    default_policy = allow
    # Create an entry for each user allowed to run autostart
    myuserid = {
    allow = true
    }

    5. Open the term and execute

sudo launchctl load /Library/LaunchDaemons/org.virtualbox.vboxautostart.plist

VBoxManage modifyvm "<vmname>" –autostart-enabled on VBoxManage modifyvm "<vmname>" --autostop-type acpishutdown

    6. Restart the mac then open virtualbox GUI to verify


Debug:
    if any error, use the command in plist file(like below) to debug

/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostartDarwin.sh /etc/vbox

 

在Mac上自动启动VirutalBox中的虚拟机 (Auto start VirtualBox VM in mac OSX)

标签:any   shutdown   启动   pre   box   before   nts   default   das   

原文地址:https://www.cnblogs.com/xxzpjzy/p/12557887.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!