GriMel
GriMel

Reputation: 2320

Access shared folder in VirtualBox from command prompt Host Ubuntu Guest Win7

I have Win7 installed in VirtualBox as guest and I've shared my "MyFolder" for this.
So, I can see it in guest's Windows Explorer as "MyFolder(\\vboxsrv) (E:)"
How can I access this folder from command prompt?
E: and pushd \\vboxrsv don't work

Upvotes: 2

Views: 5677

Answers (4)

alpha_989
alpha_989

Reputation: 5360

My best experience has been to make a scheduled task that runs on system start using the following command:

schtasks /create /tn "user_mount" /tr "net use \\user\20034 /user:user_user password /persistent:yes" /sc onstart /RU SYSTEM /rl highest

Just because you have the /persistent tag on doesn't mean it will survive restarts.

I was getting very intermittent connections to my server, this pretty much solved it 100%.

Upvotes: 0

Johannes Overmann
Johannes Overmann

Reputation: 5161

I had the same problem when using an elevated command prompt. In this case I needed to map the same drive letter again. From within the elevated command prompt do

net use

This will show the correctly mapped drive letter, but the letter is inaccessible from within the elevated command promt. Then map the same drive letter again:

net use f: \\vboxsrv\Shared

Now F: is accessible.

The reason is that elevated command prompts usually create a new logon session which do not share the symbolic links with the existing login sessions.

Upvotes: 2

GriMel
GriMel

Reputation: 2320

Manually ran cmd from within File Explorer and now I can access E:

  1. Open File Explorer
  2. Go to E:
  3. Click Alt+D
  4. Enter cmd
  5. PROFIT!

It's not an universal solution, but in my case it solved the issue.

Upvotes: 4

Ghasem Pahlavan
Ghasem Pahlavan

Reputation: 721

You must first install VirtualBox extension pack then:

1- Create a shared folder in virtual box and check the auto-mount and Make permanent checkboxes.
2- In your Windows, open the Command Prompt
3- Type E: and press Enter.(E is your shared folder drive in File explorer)

Finish :).

Upvotes: 0

Related Questions