USB drives do not connect to Virtualbox 7.0.2 under macOS host

893次阅读
没有评论

https://www.virtualbox.org/ticket/21218

USB drives do not connect to Virtualbox 7.0.2 under macOS host

汇报人: ianr77 属主:
组件: USB 版本: VirtualBox-7.0.2
关键词: 抄送:
Guest type: Linux Host type: Mac OS X

描述

Attempting to attach a USB drive from the host os (macOS) to the guest (Lubuntu) fails, even when drives are unmounted on the host, and an appropriate USB filter has been defined. Errors as follows:Failed to attach the USB device SanDisk Cruzer [0100] to the virtual machine Lubuntu 2. Failed to create a proxy device for the USB device. (Error: VERR_SHARING_VIOLATION).

Log attached.Failed to attach the USB device SanDisk Cruzer [0100] to the virtual machine Lubuntu 2. Could not find a USB device with uuid {}. Callee RC: NS_ERROR_FAILURE (0X80004005)

附件 (2)

Oldest firstNewest first

  ThreadedShow commentsShow property changes

变更历史 (17)

by ianr77, 12个月 ago

Attachment: Lubuntu 2-2022-10-30-00-51-08.logadded

Log

comment:1 by LGFox, 12个月 ago

I have the same issue on MacOS Ventura 13.0, guest system Windows 10.

As recommended here ​https://forums.virtualbox.org/viewtopic.php?f=8&t=107333, I tried to install VB 6.1.40, but it didn’t work on Ventura at all.

I think it has nothing to do with the guest system because I also tried Windows 7, Windows XP as guest systems.

Using USB filters won’t work either.

跟随:  14comment:2 by LGFox, 12个月 ago

Thanks to a guy Matafaga, I managed to get USB connected on MacOS Ventura 13.0 with VB 7.0.2:

  1. Start VB using “sudo virtualbox”
  2. Go to your guest OS settings->Ports->USB and select “USB 3.0 (xHCI)”
  3. Then just start your guest OS and USB devices should work. No need to use USB filters.

comment:3 by mstadler, 12个月 ago

Same issue is still happening in Virtualbox 7.0.4.

“sudo virtualbox” is not a viable solution or workaround. Mac users need a proper fix for this.

comment:4 by yagee, 12个月 ago

Same problem. USB disks won’t work with MacOS 13 host.

by Jimson, 11个月 ago

Attachment: VBox.logadded

Vbox.log file for issue with OL8 VM

comment:5 by aeichner, 10个月 ago

This is currently under investigation and the problem description was passed to Apple, waiting for a response from them.

comment:6 by LGFox, 10个月 ago

I still have this issue on VB 7.0.6 and MacOS Ventura 13.1

BTW, after “sudo virtualbox” command the virtual machine becomes inaccessable when VB is running normally. You can fix this by sudo chown -R my_user V_MACHINE_FOLDER

Last edited 10个月 ago by LGFox (上一个) (差异)

comment:7 by VBoxer1, 7个月 ago

Confirming this issue for VB 7.0.8 on macOS Ventura 13.3.1.

Sorry to say that, but in my impression, macOS is getting worse with every release. Perhaps the next major release will be macOS Vista :-(

comment:8 by Krunoslav, 7个月 ago

This was reported 6 months ago and nobody is still looking into this? Virtual box 7 on Mac is practically unusable without USB support. How to get someones attention on this matter?

comment:9 by aeichner, 7个月 ago

As I wrote four months ago we passed the issue to Apple because we can’t find out what is going wrong, something on their end blocks devices from being passed through. They are still investigating the issue…

跟随:  11comment:10 by amaksoft, 5个月 ago

Any updates on this issue? I’ve tried both VirtualBox and VMware Fusion and noticed that USB works fine for vmware. A quick check shows that they run the VM process as root:amaksoft@amaksoft-mbp ~ $ ps aux | grep ubuntu root 62701 1.8 1.6 68760190484 1057128 s006 S 9:26pm 1:10.14 /Applications/VMware Fusion.app/Contents/Library/vmware-vmx -s vmx.noUIBuildNumberCheck=TRUE -# product=1;name=vmrun;version=1.17.0;buildnumber=21581413;licensename=VMware Fusion for Mac OS;licenseversion=13.0; -@ duplex=3;msgs=ui /Users/amaksoft/my_vagrant_vms/ubuntu-22.10/.vagrant/machines/default/vmware_desktop/0cf5485e-1ba1-44a5-bb9d-0e05fe0258e5/ubuntu-22.10-amd64.vmx

While VirtualBox VM process runs as regular useramaksoft@amaksoft-mbp ~ $ ps aux | grep ubuntu amaksoft 78253 15.8 2.4 37522200 1596612 ?? S 10:05pm 0:14.79 /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless –comment ubuntu-mantic64_default_1685917378922_81181 –startvm 4d1a000a-1f4d-47ee-8ea8-3f7602082f88 –vrde config

Not sure i am comparing the right processes though. Is there any extra information i can gather to help?

in reply to:  10comment:11 by amaksoft, 5个月 ago

Following up. Further investigation shows that VMWare binary has setuid bit and is owned by root:amaksoft@amaksoft-mbp ~ $ ls -l@ /Applications/VMware\ Fusion.app/Contents/Library/vmware-vmx -rwsr-xr-x@ 1 root wheel 35826512 10 Apr 06:47 /Applications/VMware Fusion.app/Contents/Library/vmware-vmx com.apple.provenance 11

While VirtualBox being owned by root, has no setuid bit:amaksoft@amaksoft-mbp ~ $ ls -l /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless -rwxr-xr-x 1 root admin 164192 17 Apr 18:52 /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless

So runningsudo chmod u+s /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless

seems to have solved the issue for me (took some extra dance to grant shell app the permission to change the file attributes though). The VBoxHeadless process runs as root now:amaksoft@amaksoft-mbp ~ $ ps aux | grep ubuntu root 90736 11.8 2.8 37531720 1911896 ?? S 10:38pm 1:28.94 /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless –comment ubuntu-mantic64_default_1685917378922_81181 –startvm 4d1a000a-1f4d-47ee-8ea8-3f7602082f88 –vrde config

USB connects/disconnects successfully.

Limitations: Only works for headless and detachable modes. GUI only mode uses a differenf binary VirtualBoxVM that breaks as apparently you are not allowed to use setuid bit for GUI MacOS apps:2023-06-06 23:03:25.864 VirtualBoxVM[98777:6777878] The application with bundle ID org.virtualbox.app.VirtualBoxVM is running setugid(), which is not allowed. Exiting.

Summarising: As long as I run VMs in headless or detachable modes, I am not forced to launch VirtualBox via sudo every time, which was the most disturbing part. I’d say that this is a much cleaner workaround. Can it be considered as a solution? Can make the VirtualBox installer set setuid bit for VBoxHeadless out for the box?

Last edited 5个月 ago by amaksoft (上一个) (差异)

comment:12 by amaksoft, 5个月 ago

UPD: After checking the sources i see that MacOS installer’s postflight script is supposed to set the setuid bits for VboxHeadless https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Installer/darwin/VirtualBox/postflight#L108

However it wasn’t the case for me on VirtualBox 7.0.8 r156879amaksoft@amaksoft-mbp ~ $ /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless –version Oracle VM VirtualBox Headless Interface 7.0.8 Copyright (C) 2008-2023 Oracle and/or its affiliates 7.0.8r156879 amaksoft@amaksoft-mbp ~ $ ls -l /Applications/VirtualBox.app/Contents/{MacOS/VBoxNetAdpCtl,MacOS/VBoxHeadless,MacOS/VBoxNetDHCP,MacOS/VBoxNetNAT,Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM} -rwxr-xr-x 1 root admin 164192 17 Apr 18:52 /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless -rwsr-xr-x 1 root admin 71264 17 Apr 18:50 /Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl -rwxr-xr-x 1 root admin 236144 17 Apr 18:51 /Applications/VirtualBox.app/Contents/MacOS/VBoxNetDHCP -rwxr-xr-x 1 root admin 303104 17 Apr 18:51 /Applications/VirtualBox.app/Contents/MacOS/VBoxNetNAT -rwxr-xr-x 1 root admin 1185088 17 Apr 18:52 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM

The only binary out of all listed in the postflight script that has setuid bit is VBoxNetAdpCtl. The rest don’t have it.

Why? Let’s investigate the install package:amaksoft@amaksoft-mbp ~ $ mkdir VboxPkg amaksoft@amaksoft-mbp ~ $ cd VboxPkg amaksoft@amaksoft-mbp ~/VboxPkg $ xar -xf /Volumes/VirtualBox/VirtualBox.pkg amaksoft@amaksoft-mbp ~/VboxPkg $ cd VirtualBox.pkg amaksoft@amaksoft-mbp ~/VboxPkg/VirtualBox.pkg $ cat Scripts | gunzip -dc | cpio -i 12 blocks amaksoft@amaksoft-mbp ~/VboxPkg/VirtualBox.pkg $ cat postflight | tail -n 15 # # Workaround for 10.11 beta 6 in which the above chown strips the set-uid-to-root bit. # SET_UID_BINARIES=”MacOS/VBoxNetAdpCtl” for bin in ${SET_UID_BINARIES}; do chmod u+s “/Applications/VirtualBox.app/Contents/${bin}” done # Install provisioning profile if present, needed by VBoxHeadless. if [ -f /Applications/VirtualBox.app/Contents/embedded.provisionprofile ]; then profiles -i -F /Applications/VirtualBox.app/Contents/embedded.provisionprofile fi exit 0;

The install package only applies setuid to VBoxNetAdpCtl, which matches the binaries atributes I observe above.

Why doesn’t it match the code in trunk?

Anyway, here’s the extended workaround shell command:amaksoft@amaksoft-mbp ~ $ for f in /Applications/VirtualBox.app/Contents/{MacOS/VBoxNetAdpCtl,MacOS/VBoxHeadless,MacOS/VBoxNetDHCP,MacOS/VBoxNetNAT}; do sudo chmod u+s $f; done

Last edited 5个月 ago by amaksoft (上一个) (差异)

comment:13 by Klaus Espenlaub, 5个月 ago

The postflight scripts in 7.0 and trunk are the same. Our packaging uses a bit of trickery to adapt it to the VBOX_WITH_HARDENING build config flag, which isn’t set any more since 7.0. Which removes the line https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Installer/darwin/VirtualBox/postflight#L106 . To be honest I’m unsure why VBoxNetAdpCtl is still suid root.

USB handling should work through entitlements, the provisioning profile and code signing.

in reply to:  2 ; 跟随:  15comment:14 by codergoy, 3个月 ago

Replying to LGFox:

Thanks to a guy Matafaga, I managed to get USB connected on MacOS Ventura 13.0 with VB 7.0.2:

  1. Start VB using “sudo virtualbox”
  2. Go to your guest OS settings->Ports->USB and select “USB 3.0 (xHCI)”
  3. Then just start your guest OS and USB devices should work. No need to use USB filters.

Does not work with 2023 M2 Max MBP + most recent Mac OS (Ventura 13.5.1).

Tried the extended workaround shell command from above, as well.

Would be great if we could get this sorted.

Last edited 3个月 ago by codergoy (上一个) (差异)

in reply to:  14comment:15 by unturned3, 2个月 ago

Replying to codergoy:

Does not work with 2023 M2 Max MBP + most recent Mac OS (Ventura 13.5.1).

Tried the extended workaround shell command from above, as well.

Would be great if we could get this sorted.

I’m glad I decided not to upgrade to Ventura. I’m using the setuid method on MacOS 12.6

正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)

文心AIGC

2023 年 11 月
 12345
6789101112
13141516171819
20212223242526
27282930  
文心AIGC
文心AIGC
人工智能ChatGPT,AIGC指利用人工智能技术来生成内容,其中包括文字、语音、代码、图像、视频、机器人动作等等。被认为是继PGC、UGC之后的新型内容创作方式。AIGC作为元宇宙的新方向,近几年迭代速度呈现指数级爆发,谷歌、Meta、百度等平台型巨头持续布局
文章搜索
热门文章
潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026 Jay 2025-12-22 09...
“昆山杯”第二十七届清华大学创业大赛决赛举行

“昆山杯”第二十七届清华大学创业大赛决赛举行

“昆山杯”第二十七届清华大学创业大赛决赛举行 一水 2025-12-22 17:04:24 来源:量子位 本届...
MiniMax海螺视频团队首次开源:Tokenizer也具备明确的Scaling Law

MiniMax海螺视频团队首次开源:Tokenizer也具备明确的Scaling Law

MiniMax海螺视频团队首次开源:Tokenizer也具备明确的Scaling Law 一水 2025-12...
天下苦SaaS已久,企业级AI得靠「结果」说话

天下苦SaaS已久,企业级AI得靠「结果」说话

天下苦SaaS已久,企业级AI得靠「结果」说话 Jay 2025-12-22 13:46:04 来源:量子位 ...
最新评论
ufabet ufabet มีเกมให้เลือกเล่นมากมาย: เกมเดิมพันหลากหลาย ครบทุกค่ายดัง
tornado crypto mixer tornado crypto mixer Discover the power of privacy with TornadoCash! Learn how this decentralized mixer ensures your transactions remain confidential.
ดูบอลสด ดูบอลสด Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
Obrazy Sztuka Nowoczesna Obrazy Sztuka Nowoczesna Thank you for this wonderful contribution to the topic. Your ability to explain complex ideas simply is admirable.
ufabet ufabet Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
ufabet ufabet You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
ufabet ufabet Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
热评文章
摩尔线程的野心,不藏了

摩尔线程的野心,不藏了

摩尔线程的野心,不藏了 量子位的朋友们 2025-12-22 10:11:58 来源:量子位 上市后的仅15天...
摩尔线程的野心,不藏了

摩尔线程的野心,不藏了

摩尔线程的野心,不藏了 量子位的朋友们 2025-12-22 10:11:58 来源:量子位 上市后的仅15天...
AI体育教练来了!中国团队打造SportsGPT,完成从数值评估到专业指导的智能转身

AI体育教练来了!中国团队打造SportsGPT,完成从数值评估到专业指导的智能转身

AI体育教练来了!中国团队打造SportsGPT,完成从数值评估到专业指导的智能转身 量子位的朋友们 2025...
AI体育教练来了!中国团队打造SportsGPT,完成从数值评估到专业指导的智能转身

AI体育教练来了!中国团队打造SportsGPT,完成从数值评估到专业指导的智能转身

AI体育教练来了!中国团队打造SportsGPT,完成从数值评估到专业指导的智能转身 量子位的朋友们 2025...
真正面向大模型的AI Infra,必须同时懂模型、系统、产业|商汤大装置宣善明@MEET2026

真正面向大模型的AI Infra,必须同时懂模型、系统、产业|商汤大装置宣善明@MEET2026

真正面向大模型的AI Infra,必须同时懂模型、系统、产业|商汤大装置宣善明@MEET2026 量子位的朋友...