Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 689  / 2 Years ago, sat, september 10, 2022, 12:20:55

Ok, so I have a machine with a dual boot installed (Windows 8 and Ubuntu 12.10). They are on separate hard drives. I already have Virtualbox set up to boot from the linux physical hard drive (Windows 8 Host). I also have shared my Windows User folder using the Virtualbox folder share. Here is my problem: I would love to be able to just go to the Documents folder to access my Windows folder Documents. I think there is a way to do this with symlinks... but sometimes I do need to boot just into Ubuntu (not in Virtualbox) and it messes up the symlinks (because the Windows Documents are now not accessible via the Virtualbox folder but through the actual hard drive). Any ideas?
Thanks in advance!


More From » 12.10

 Answers
6

Thanks all who were trying to help.



I finally figured it out.



Here is what I did:



sudo gedit /usr/local/bin/mountscript.sh


In Virtualbox make sure to create a share for what ever drive you want to access (mine is C), and name the share C. Oh, and make sure it is marked permanent.



Paste in this and save (make sure and replace [UBUNTU_USERNAME] and [WINDOWS_USERNAME] with their respective usernames):



#!/bin/bash
sudo mount -t vboxsf C /media/C
sudo mount --bind /media/C/Users/[WINDOWS_USERNAME]/Documents/ ~/Documents/
sudo mount --bind /media/[UBUNTU_USERNAME]/C/Users/[WINDOWS_USERNAME]/Documents /home/[UBUNTU_USERNAME]/Documents


Then to make it executable run this:



chmod +x /usr/local/bin/mountscript.sh


Then to make sure you do not have to enter your password each time you boot:



sudo visudo


Then at the end add this:



[UBUNTU_USERNAME] ALL=NOPASSWD: /usr/local/bin/mountscript.sh, /bin/mount


Then open the dash and search for: Startup Applications.



Click add, and in the name field type: Mount Script



In the command field type: /usr/local/bin/mountscript.sh



Click add. Close out everything and reboot!



Hope this helps!


[#31793] Sunday, September 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rofity

Total Points: 182
Total Questions: 98
Total Answers: 115

Location: Albania
Member since Sat, Jan 7, 2023
1 Year ago
rofity questions
Mon, Apr 25, 22, 12:28, 2 Years ago
Tue, Jul 5, 22, 16:53, 2 Years ago
Sat, Apr 8, 23, 05:32, 1 Year ago
Mon, May 10, 21, 22:51, 3 Years ago
;