{"id":33749,"date":"2021-05-14T14:45:31","date_gmt":"2021-05-14T14:45:31","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=33749"},"modified":"2021-05-14T14:45:31","modified_gmt":"2021-05-14T14:45:31","slug":"fix-virtualbox-shared-folder-unable-open","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/05\/fix-virtualbox-shared-folder-unable-open\/","title":{"rendered":"Fix VirtualBox Shared Folder Is Locked \/ Unable to Open in Ubuntu 21.04"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2016\/07\/virtualbox-icon245.png\" alt=\"Virtualbox\" width=\"245\" height=\"250\" class=\"alignleft size-full wp-image-6036\" \/><\/p>\n<p>Running Ubuntu as virtual machine via VirtualBox? You may encounter permission issue to access the shared folder between host and guest.<\/p>\n<p>Shared Folders is an useful feature for file sync between Virtualbox host and guest OSes. However, after you created one, the shared folder is marked with cross and lock icons. And it pops up an error dialog when you trying to open it:<\/p>\n<blockquote><p>Unhandled error message:<br \/>\nGDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Unix process subject does not have uid set.<\/p><\/blockquote>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-locked.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-locked-600x295.jpg\" alt=\"\" width=\"600\" height=\"295\" class=\"aligncenter size-large wp-image-33751\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-locked-600x295.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-locked-300x147.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-locked-768x377.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-locked.jpg 930w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Or it prompts permission issue while accessing from the left pane in file manager:<\/p>\n<blockquote><p>You do not have permissions necessary to view the contents of &#8220;xxx&#8221;<\/p><\/blockquote>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-notaccess.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-notaccess-600x301.jpg\" alt=\"\" width=\"600\" height=\"301\" class=\"aligncenter size-large wp-image-33752\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-notaccess-600x301.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-notaccess-300x151.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-notaccess-768x386.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/vbox-share-notaccess.jpg 926w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Fix shared folder permission issue:<\/h3>\n<p>The shared folder belongs to <code style=\"border:none;\">vboxsf<\/code> group in the guest. All you need to do is add your user into this group.<\/p>\n<p>There are a few ways to add an user to a group. Here I&#8217;m going to do it via a single command:<\/p>\n<ol>\n<li>Firstly, start the virtual machine and login.<\/li>\n<li>Open a terminal window from system app launcher.<\/li>\n<li>When terminal opens, run command to check your username in case you don&#8217;t remember:\n<pre style=\"border:none;\">whoami<\/pre>\n<\/li>\n<li>Finally add user to <i>vboxsf<\/i> group (<i>replace <u>USER_NAME<\/u> with what printed in last command.<\/i>):\n<pre style=\"border:none;\">sudo adduser USER_NAME vboxsf<\/pre>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/add-user-tovboxsf.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/add-user-tovboxsf-600x220.jpg\" alt=\"\" width=\"600\" height=\"220\" class=\"aligncenter size-large wp-image-33753\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/add-user-tovboxsf-600x220.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/add-user-tovboxsf-300x110.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/add-user-tovboxsf-768x282.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/add-user-tovboxsf.jpg 802w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Restart VM to apply change and enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>Running Ubuntu as virtual machine via VirtualBox? You may encounter permission issue to access the shared folder between host and guest. Shared Folders is an useful feature for file sync between Virtualbox host and guest OSes. However, after you created one, the shared folder is marked with cross and lock icons. And it pops up [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":33750,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[38],"class_list":["post-33749","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-virtualbox"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=33749"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33749\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/33750"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=33749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=33749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=33749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}