美文网首页
macOS Big Sur安装Singularity容器

macOS Big Sur安装Singularity容器

作者: SnorkelingFan凡潜 | 来源:发表于2021-03-31 16:35 被阅读0次

Homebrew的所有安装包所在位置/usr/local/Cellar/

  1. MacOS安装singularity借助brew工具更快
brew install virtualbox && \
brew install vagrant && \
brew install vagrant-manager
  1. 按官方步骤进行到vagrant up步骤会报错


    image.png
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'sylabs/singularity-3.5-ubuntu-bionic64' version '20191206.0.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "a3764818-dca9-40c9-ba3b-881a1f7cf3e5", "--type", "headless"]

Stderr: VBoxManage: error: The virtual machine 'vm-singularity_default_1617180752799_59055' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

报错原因并不是卸载和重新安装VirtualBox、vagrant-manager的问题,核心问题是Mac的隐私安全权限要打开
Adjust the privacy settings of Big Sur: System Preferences > Security and Privacy > click the allow button

随后可解决

$ vagrant ssh
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

vagrant@vagrant:~$ singularity version
3.5.1

此问题附带了解的卸载安装办法(非上面报错所需)

  • How to Uninstall VirtualBox Completely from Mac
  1. Download the latest VirtualBox installer file from Oracle if you don’t have it already on your Mac
  2. Mount the VirtualBox disk image file and open that mounted dmg in the Finder
  3. Double-click on the text file named “VirtualBox_Uninstall.tool” to launch into a new Terminal window
sudo su
csrutil clear
reboot

重新install 直接用brew reinstall,不然还是有残余文件

$ brew reinstall virtualbox
==> Caveats
virtualbox requires a kernel extension to work.
If the installation fails, retry after you enable it in:
  System Preferences → Security & Privacy → General

For more information, refer to vendor documentation or this Apple Technical Note:
  https://developer.apple.com/library/content/technotes/tn2459/_index.html

==> Downloading https://download.virtualbox.org/virtualbox/6.1.18/VirtualBox-6.1.18-142142-OSX.dmg
Already downloaded: /Users/lifan/Library/Caches/Homebrew/downloads/8a2f9f8c88b8e2367e27c037d80121759f238ee00c66d0fe35232bc1035b8f96--VirtualBox-6.1.18-142142-OSX.dmg
==> Uninstalling Cask virtualbox
==> Running uninstall script VirtualBox_Uninstall.tool
Password:

Welcome to the VirtualBox uninstaller script.

Executing: /usr/bin/kmutil showloaded --list-only --bundle-identifier org.virtualbox.kext.VBoxUSB
No variant specified, falling back to release
Executing: /usr/bin/kmutil showloaded --list-only --bundle-identifier org.virtualbox.kext.VBoxNetFlt
No variant specified, falling back to release
Executing: /usr/bin/kmutil showloaded --list-only --bundle-identifier org.virtualbox.kext.VBoxNetAdp
No variant specified, falling back to release
Executing: /usr/bin/kmutil showloaded --list-only --bundle-identifier org.virtualbox.kext.VBoxDrv
No variant specified, falling back to release
No VirtualBox files, directories, KEXTs or packages to uninstall.
Done.
==> Uninstalling packages; your password may be necessary:
==> Removing files:
/usr/local/bin/vboximg-mount
==> Purging files for version 6.1.18,142142 of Cask virtualbox
==> Installing Cask virtualbox

——————
参考链接:https://github.com/hashicorp/vagrant/issues/12049

相关文章

网友评论

      本文标题:macOS Big Sur安装Singularity容器

      本文链接:https://www.haomeiwen.com/subject/miwohltx.html