How to automatically have shared folders useable on login?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
tomstealth
Posts: 6
Joined: 23. Apr 2009, 14:43
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp & linux

How to automatically have shared folders useable on login?

Post by tomstealth »

Hello virtualbox forums, I have successfully installed virtual windows xp on host windows xp. I have a shared folder set up which guest windows correctly mounts as a network drive. However this drive is not usable immediately as it needs double-clicking ie to be opened once. How can I force the folder to be accessible? At the moment, I have added a startup command line file that navigates to "Z:\" on login. Which actually works, except I don't know how to close the explorer window automatically now.

Can anyone provide any superior solutions? Thanks!
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: How to automatically have shared folders useable on login?

Post by vbox4me2 »

Make a .cmd file and place "dir z:\" in it, create a shortcut to this file and place it in your startup folder.
tomstealth
Posts: 6
Joined: 23. Apr 2009, 14:43
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp & linux

Re: How to automatically have shared folders useable on login?

Post by tomstealth »

Thanks a lot, I'll give it a go. Do I include the quotes, just in case someone answers before I try it?

Cheers!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to automatically have shared folders useable on login?

Post by Perryg »

No " " but when you create the shortcut make sure that the target says Z:\ and nothing else, the start in line should be blank. You can do this by right clicking the shortcut and left click on property.

One other thing that you might have missed (most do) when mounting the share in windows from the command line use net use (z: \\vboxsvr\sharename -p to make it persistent).
tomstealth
Posts: 6
Joined: 23. Apr 2009, 14:43
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp & linux

Re: How to automatically have shared folders useable on login?

Post by tomstealth »

Hmm. Tried with no " with no luck. Didn't check whether the shortcut points only to Z or not though. I believe the share is already persistent as it shows up every time without fail, it just shows 0 bytes until it's opened. Hmm.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to automatically have shared folders useable on login?

Post by Perryg »

the 0 bytes means that it is not mounted. run the mount with the -p. And the target must have the Z:\ only
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: How to automatically have shared folders useable on login?

Post by vbox4me2 »

You do not point or make a shortcut to Z:

You make a new file "dirzdrive.cmd" and place it into c:\
Then edit this file with notepad and place this line into it "dir z:\", hit save.
Click on this file once and select 'copy', then go to your startup folder and select 'paste as shortcut'.
Done, time to coffee, cake or icecream.
tomstealth
Posts: 6
Joined: 23. Apr 2009, 14:43
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp & linux

Re: How to automatically have shared folders useable on login?

Post by tomstealth »

Oh dear! I must admit I haven't RTFM. I got PerryG's thing working, except it still pops up with an explorer window on login, which is where I started! (Goes off to try other suggestion)
tomstealth
Posts: 6
Joined: 23. Apr 2009, 14:43
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp & linux

Re: How to automatically have shared folders useable on login?

Post by tomstealth »

Yep. Just create a file whatever.cmd, type "net use z: \\vboxsvr\sharename -p" without the quotes and save the file, copy and paste as a shortcut in startup programs, works every time, no problem, I'll read the manual next time, thanks very much!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to automatically have shared folders useable on login?

Post by Perryg »

If all you were trying to achieve here was to make the share accessible when you open your Guest you only need to run the command (z: \\vboxsvr\sharename -p) once. You do not need it in a startup script. the -p makes it persistent and will be available every time you open the guest.

Now if you want it to open the share to the desktop every time you need the script that vbox4me2 and I said (different commands same outcome).
tomstealth
Posts: 6
Joined: 23. Apr 2009, 14:43
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp & linux

Re: How to automatically have shared folders useable on login?

Post by tomstealth »

Well, I just want it so that when I have it setup for files to save to a shared folder from a guest, it doesn't give me loads of "folder or device not found" or whatever unless the share has been opened by explorer.. Which now doesn't happen. And also, there are no annoying folders everytime I start the virtual machine. I don't know whether because of the command being run once or the startup script, maybe I'll try without the script later to see if it still works.

The folder was already accessible before I got helped, it just was giving the above problems before.
Post Reply