VirtualBox compilation on Android encounters a problem with shared folders

Source: Internet
Author: User

Story: With the Mac system, but the chip manufacturers provide the solution does not provide the Mac system compiled Android, had to install the virtual machine. Parallels Desktop in the virtual machine is relatively easy to use, but the pit daddy is, compile time make command hang, hint "segmentation fail", Google not fruit. Had to re-enable VirtualBox.

The shared folder was set up in virtual machine management, and then the permissions were not found:

? ~ Ls/media/sf_androidbuild LS: Unable to open Directory/media/sf_androidbuild: Insufficient permissions

The workaround is to mount the Mount command in

?  ~ sudo mkdir-m 755/mnt/androidbuild? ~ sudo mount-t vboxsf-o androidbuild/mnt/androidbuild

The mount command needs to know at least three information:

    1. File system type to load the object: vboxsf

    2. Device name to load the object: Androidbuild, which is the name of the virtual machine management settings

    3. To which directory to load:/mnt/androidbuild

After the mount, the current user does not have write permission, plus the parameter '-O ':

? ~ sudo mount-t vboxsf-o rw,uid=1000,gid=1000 androidbuild/mnt/androidbuild

Where UID and GID represent the ID of the current user and can be found using the ' ID ' command:

? ~ ID caohonguid=1000 (caohong) gid=1000 (Caohong) groups=1000 (Caohong), 4 (ADM), (CDROM), (sudo), (DIP), (Plugdev) , 109 (lpadmin), 124 (Sambashare)

The results are as follows:

? ~/mnt/androidbuild/ll95 Mount | grep vboxsf androidbuild on/media/sf_androidbuild type vboxsf (GID=999,RW) androidbuild on/mnt/androidbuild type Vboxs F (UID=1000,GID=1000,RW)

This is OK, you will also encounter a compile-time error: "LN: Could not create symbolic link" out/target/": Read-only file system"

The answer is found here: Cannot create symlinks in VirtualBox shared Folders VirtualBox after a certain version of the link is disabled in the shared folder (symbol link), The workaround method is:

?  ~ Vboxmanage setextradata ubuntu64 vboxinternal2/sharedfoldersenablesymlinkscreate/androidbuild 1? ~ Vboxmanage getextradata ubuntu64 enumeratekey:gui/infodlgstate, Value:400,450,normalkey:gui/lastcloseaction, Value : Poweroffkey:gui/lastguestsizehint, Value:640,480key:gui/lastnormalwindowposition, Value:32,44,640,342,maxkey: Gui/lastscalewindowposition, Value:20,52,1245,694,maxkey:gui/virtualscreentohostscreen0, Value:1key: Vboxinternal2/sharedfoldersenablesymlinkscreate/androidbuild, Value:1

' Ubuntu64 ' is the name of the virtual machine, ' Androidbuild ' is the name of the shared folder, after the successful setting with ' Vboxmanage getextradata ' can be found, restart to fix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.