Guest Additions are available for MacOS starting with VirtualBox 6.0.
从VirtualBox 6.0开始,MacOS可以使用来宾添加功能。
Installing:
安装:
- Boot & login into your guest macOS.
- In VirtualBox UI, use menu
Devices | Insert Guest Additions CD image...
- CD will appear on your macOS desktop, open it.
- Run
VBoxDarwinAdditions.pkg
.
- Go through installer, it's mostly about clicking Next.
- At some step, macOS will be asking about permissions for Oracle. Click the button to go to System Preferences and allow it.
- If you forgot/misclicked in step 6, go to macOS
System Preferences | Security & Privacy | General
. In the bottom, there will be a question to allow permissions for Oracle. Allow it.
Troubleshooting
故障排除
- macOS 10.15 introduced new code signing requirements; Guest additions installation will fail. However, if you reboot and apply step 7 from list above, shared clipboard will still work.
- VirtualBox < 6.0.12 has a bug where Guest Additions service doesn't start. Use newer VirtualBox.
- In the guest Mac, open the Terminal and go for a reboot on the Recovery partition
sudo nvram "recovery-boot-mode=unused"
sudo reboot
- Now you're in Recovery mode, enter the Terminal and do:
csrutil disable
spctl kext-consent add VB5E2TV963
nvram -d recovery-boot-mode
reboot
- Back in "normal" mode, open the Terminal, and do:
sudo mount -uw /
sudo chown :admin /System/Library/Extensions/
sudo chmod 775 /System/Library/Extensions/
Run the Guest Additions installer and go through the end
(in principle, it goes through successfully)
Now in the terminal, do:
sudo chown :wheel /System/Library/Extensions/
sudo chmod 755 /System/Library/Extensions/
sudo nvram "recovery-boot-mode=unused"
sudo reboot
- Again in Recovery mode, go into the Terminal and do:
csrutil enable
nvram -d recovery-boot-mode
reboot
You should be set.
你应该准备好了。
Guest additions are not available for Mac OS X. You can get features like clipboard sync and shared folders by using VNC and SMB. Here's my answer on a similar question.
Mac OS X不支持来宾添加功能。你可以通过使用VNC和SMB获得剪贴板同步和共享文件夹等功能。以下是我对类似问题的回答。
You can use SSH and SFTP as suggested here.
您可以按照这里的建议使用SSH和SFTP。
- In the Guest OS (Mac OS X), open System Preferences > Sharing, then activate Remote Login; note the ip address specified in the Remote Login instructions, e.g. ssh [email protected]
- In VirtualBox, open Devices > Network > Network Settings > Advanced > Port Forwarding and specify Host IP = 127.0.0.1, Host Port 2222, Guest IP 10.0.2.15, Guest Port 22
- On the Host OS, run the following command
sftp -P 2222 [email protected]
; if you prefer a graphical interface, you can use FileZilla
Replace user
and 10.0.2.15
with the appropriate values relevant to your configuration.
使用与您的配置相关的相应值替换USER和10.0.2.15。
I've the same problem, and by the "trial and error" method I have the steps to install the guest additions on a MacOS guest:
我也有同样的问题,通过“试错”的方法,我得到了在MacOS来宾上安装来宾添加的步骤:
- insert the guest additions cd
- open the cd on file manager
- double click on VBoxDarwinAdditions.pkg
- the installer opens, then click contine
- next screen to set location of installed files, only press install
- your password can be asked a couple of time while installing, write
it and continue
- this is the tricky part, on my installation, macos show an message
about the driver created by oracle won't be installed because a
security issue, it has the option to enable it, so click on the
button to open security screen and click on the allow button next to
the oracle software listed at bottom of the security settings
window, it will ask your password again. Meanwhile the pkg installer
continued as if it has permissions and will say "install finished",
but I don't believe it so, once I unlocked the oracle drivers
installations I repeat the whole process from step 3, and in the
second round all installs without asking more than the first
password to install.
And it is done!
一切都结束了!
Above, someone gave a hint:
上图中,有人给出了一个暗示:
At some step, macOS will be asking about permissions for Oracle. Click the button to go to System Preferences and allow it.
If you forgot/misclicked in step 6, go to macOS System Preferences | Security & Privacy | General. In the bottom, there will be a question to allow permissions for Oracle. Allow it.
在某个步骤中,MacOS将询问Oracle的权限。单击按钮转到系统首选项并允许它。如果您在第6步中忘记/错误点击,请转到MacOS系统首选项|安全与隐私|常规。在底部,会出现一个问题,要求授予Oracle权限。允许它。
It took me a couple of hours but I did finally find what he was talking about - it's actually in the bottom of the Mac - click on the gear icon and you'll find it eventually.
我花了几个小时,但我终于找到了他在说什么--它实际上在Mac的底部--点击齿轮图标,你最终会找到它的。
You need to update your virtualbox sw. On new version, there is VBoxDarwinAdditions.pkg included in a additions iso image, in older versions is missing.
您需要更新您的VirtualBox软件。在新版本中,VBoxDarwinAdditions.pkg包含在添加的iso镜像中,在旧版本中缺失。
you can do it from the windows 10 terminal
你可以在Windows10终端上操作
step 1: open CMD in administrator mode
步骤1:在管理员模式下打开CMD
step 2 paste this open CMD cd "C:\Program Files\Oracle\Virtualbox"
步骤2粘贴这张打开的CMD CD“C:\Program Files\Oracle\VirtualBox”
step 3: paste this command in the open CMD, you must indicate the name you have in VirtualBox
步骤3:将此命令粘贴到打开的CMD中,您必须在VirtualBox中注明您的名称
VBoxManage setextradata "Virtual machine name" VBoxInternal2/EfiGraphicsResolution X
Example:
示例:
VBoxManage setextradata "Mac OS Sierra" VBoxInternal2/EfiGraphicsResolution 1280x720
Before you start, close VirtualBox!
After those manipulations start VB as Administrator!
在开始之前,关闭VirtualBox!在这些操作之后,以管理员身份启动VB!
- Run CMD as Administrator
- Use lines below one by one:
- cd "C:\Program Files\Oracle\Virtualbox"
- VBoxManage setextradata “macOS_Catalina” VBoxInternal2/EfiGraphicsResolution 1920x1080
Screen Resolutions
: 1280x720, 1920x1080, 2048x1080, 2560x1440, 3840x2160, 1280x800, 1280x1024, 1440x900, 1600x900
屏幕分辨率:1280x720,1920x1080,2048x1080,2560x1440,3840x2160,1280x800,1280x1024,1440x900,1600x900
Description:
描述:
macOS_Catalina - insert your VB machine name.
macOS_Catalina -插入您的VB计算机名称。
1920x1080 - put here your Screen Resolution.
1920x1080-在此处输入您的屏幕分辨率。
Cheers!
干杯!
Have you tried https://www.virtualbox.org/manual/ch04.html which has step-by-step instructions to help you?
你有没有试过https://www.virtualbox.org/manual/ch04.html,它有循序渐进的说明帮助你?
- Make your VM bi-directional for Clipboard and Drag & Drop
- Share folders from your host to the guest VM too.
更多回答
Guests
are allowed on Mac OS X as of 6.0. Not Guest Additions
. That is, you can use VirtualBox on a Mac now, but Guest Addtitions
is still not provided, The two aren't the same thing. See Mac OS X guests
on this page: virtualbox.org/manual/ch14.html
从6.0开始,Mac OS X上允许访客。不是Guest Additions。也就是说,你现在可以在Mac上使用VirtualBox,但仍然没有提供Guest Addtitions,这两者不是一回事。有关Mac OS X来宾的详细信息,请访问该页面:Viralbox.org/manual/ch14.html
This is incorrect. Guest Additions
are available starting with VirtualBox 6.0. I'm using it myself for shared clipboard.
这是不正确的。从VirtualBox 6.0开始提供来宾添加功能。我自己也在用它做共享剪贴板。
This is also incorrect. What do you even mean by Guest additions for host? They are intended for guests.
这也是不正确的。你所说的为主人增加访客是什么意思?它们是为客人准备的。
For me - Windows 10 20H2 Host | macOS Big Sur 11.1 Guest | VirtualBox 6.1.16 - At step 5 it says - The installation failed. The installation encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
对于我来说-Windows 10 20H2主机|MacOS Big Sur 11.1来宾|VirtualBox 6.1.16-在第5步,它说安装失败。安装遇到错误,导致安装失败。请与软件制造商联系以获得帮助。
For those of us with a MacOS Big Sur (11.x) guest.... we seem to be out of luck (for now?) according to the manual the Darwin Guest Additions are only for Mac OS X guests (Mac OS X hosts only)
对于我们这些拥有MacOS Big Sur(11.x)客户的人来说...我们似乎不走运(就目前而言?)根据手册,Darwin Guest的新增功能仅适用于Mac OS X来宾(仅限Mac OS X主机)
Impressive, I didn't understand any code, but it worked for me! It was the only solution. [macOS Catalina 10.15.3]
令人印象深刻的是,我不懂任何代码,但它对我来说很有效!这是唯一的解决办法。[MacOS Catalina 10.15.3]
This worked for me VB 6.1, Windows 10 host, macOs Catalina 10.15.7 guest.
这对我的VB6.1、Windows10主机、MacOS Catalina 10.15.7来宾操作系统都有效。
VB 6.1.14, Host Catalina 10.15.6, Guest 10.15.1. At sudo spctl kext-consent add VB5E2TV963
I get sudo: command not found
. That line seems to work without sudo. The installation did as well.
VB 6.1.14、主机Catalina 10.15.6、来宾10.15.1。在sudo spctl kext-accel add VB5E2TV963 I Get sudo:Command Not Found。这条线似乎在没有sudo的情况下也有效。安装的效果也很好。
For me - Windows 10 20H2 Host | macOS Big Sur 11.1 Guest | VirtualBox 6.1.16 - sudo nvram "recovery-boot-mode=unused"
gives error - nvram: Error setting variable - 'recovery-boot-mode': (iokit/common) not permitted.
适用于我- Windows 10 20 H2主机|macOS Big Sur 11.1访客|VirtualBox 6.1.16 - sudo nvram“recovery-boot-mode=unused”gives error - nvram:Error setting variable - 'recovery-boot-mode':(iokit/common)not permitted.
For Big Sur what worked for me (11.0.1 and newer) was to: - shutdown the vm using the apple logo then selecting shutdown. - removing the virtual harddisc from the vm. - booting it up to the EFI utility, then enter "exit". - changing the boot order to the EFI util. - readding the vhd to VM - add back the iso used to install mac with - go to the terminal after booting from that iso and enter those terminal commands. - then do the other steps from the rest of the above post (but ignore the nvram commands as they do not work).
对于Big Sur来说,对我有效的方法(11.0.1和更新版本)是:-使用苹果徽标关闭VM,然后选择Shutdown。-从VM中移除虚拟硬盘。-引导至EFI实用程序,然后输入“Exit”。-将引导顺序更改为EFI实用程序。-将vhd读取到vm-添加回用于安装Mac的iso-从该iso引导后转到终端并输入这些终端命令。-然后执行上述POST其余部分的其他步骤(但忽略NVRAM命令,因为它们不起作用)。
They are available now.
现在有货了。
@Mormegil where?
@Mormegil在哪里?
Like on any other guest OS. Take a look at the other answer by Codeguard.
像任何其他客户操作系统一样。看看Codeguard的其他答案。
In my version of virtualbox, step 2 is slightly different: you need to open the settings of your machine -> Network -> Adapter 1 -> Advanced -> Port Forwarding.
在我的VirtualBox版本中,第二步略有不同:您需要打开机器的设置->网络->适配器1->高级->端口转发。
Thanks, the other solutions didn't work for me but this works. In Virtualbox I have to keep setting it up as it resets
谢谢,其他的解决方案对我都不管用,但这个管用。在VirtualBox中,我必须在它重置时对其进行设置
In case it helps anyone, Guest Additions install failed using root user. Using another user with admin privs worked. VBox 6.0.18, Mac 10.10 (Yosemite) Guest.
如果它对任何人都有帮助,使用根用户安装Guest Additions失败。使用具有管理员权限的另一个用户可以工作。VBOX 6.0.18、Mac 10.10(优胜美地)Guest。
Hi inventorado and welcome to StackOverflow! Thanks for providing the answer -- but it could be made even better if you were to reference the specific version numbers affected to help future users know what versions to look for.
嗨inventorado,欢迎来到StackOverflow!感谢您提供答案-但如果您引用受影响的特定版本号以帮助未来用户了解要查找的版本,则可能会更好。
I wonder how changing the screen resolution might help installing Guest Additions and overcome security issues. I guess it will not.
我想知道更改屏幕分辨率如何帮助安装Guest Additions并克服安全问题。我想它不会的。
Viacheslav Rodionov, the problem is that you can't install Guest Additions
but there's another way to change Screen Resolution. Good luck! 👍
Viacheslav Rodionov,问题是你不能安装Guest Additions,但有另一种方法可以改变屏幕分辨率。祝你好运!👍
Well, the author did not ask anything regarding the resolution. Why did you decide that this is exactly the issue that should be fixed and posted an answer, not even a comment?
那么,作者并没有就该决议提出任何要求。为什么你认为这正是应该解决的问题,并发布了答案,甚至没有评论?
This is the most correct way. I searched for a long time but did not find a better solution! Have a good day!
这是最正确的方式。我找了很久,也没有找到更好的解决方案!祝你今天愉快!
I have one last question to ask Rakesh: Are you sure that you restarted your VM after you followed the steps? I got the same issue where I followed the steps and when I tried to copy text from host machine into my VM environment nothing worked until I was forced to shut down the VM and then bring it back up and found that I could paste and copying using bi-directional cut and paste.
我还有最后一个问题要问Rakesh:您确定在执行了这些步骤后重新启动了您的VM吗?当我尝试将文本从主机复制到我的VM环境中时,我遇到了同样的问题,直到我被迫关闭VM,然后重新启动它,然后发现我可以使用双向剪切和粘贴进行粘贴和复制时,才发现什么都不起作用。
我是一名优秀的程序员,十分优秀!