1

I successfully shared a folder from windows 7 to Ubuntu(in virtual box) but now I want to know how to share Ubuntu(in virtual box) to windows 7 using a command like this:

net use x: \\vboxsvr\share name

How can i do it?

Parto
  • 15,325
  • 24
  • 86
  • 117

2 Answers2

0

If you want to go for a more flexible and advanced way of sharing your Ubuntu's folders to Windows 7, check this out: https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated,%20Simple%20and%20Brief%20Way!

0

Ubuntu & VirtualBox Networking

In order to you can connect two Computer ( does NOT matter Virtual or Not conceptually ), you have to be able to "ping" any of them by the other.

WorkFlow:

We Have 2 Computer

Computer 1: IP-> 10.1.1.2 (Ubuntu)

Computer 2: IP-> 10.1.1.3 (Virtual Windows)

First : Network Checking

( The LAN Cables connected to the same VLAN )

In Computer1:

Do "ping" Computer2 by the following command in Terminal:

$ ping 10.1.1.3

The Output will be some thing like below:

PING 10.1.1.3 (10.1.49.3) 56(84) bytes of data.
64 bytes from 10.1.1.3: icmp_req=1 ttl=64 time=0.044 ms

In Computer2:
Do "ping" Computer1 by the following command in CMD:

$ ping 10.1.1.2

The output will be something like below:

PING 10.1.1.2 (10.1.49.3) 56(84) bytes of data.
64 bytes from 10.1.1.2: icmp_req=1 ttl=64 time=0.044 ms

Notice: If you can NOT "ping" a computer through another, these is must be exist some network problem. ( Check for network visibilities, VLANs, Virtual Bridge, IP range, etc)

Second: Cheking the Ubuntu (or Linux) & VirtualBox configurations

In Computer1 (Ubuntu):
1. Execute the following command in Terminal:

$ chmod -R 777 ~/Public

You don't get any output, Note that replace your desired path (folder) with ~/Public ( I use it as default )
2. Open a nautilus (File Manager) and right click on your desired folder, then click on the Sharing Options

Notice: Maybe Ubuntu wants to install samba and some other packages, lets Ubuntu to install required packages automatically.

In the opened window:

Sharing Options ShareName will be visible by the network. And Mark all of the three check marks for the first, then try another situations ;-) Then just click on the Modify Share and then the desired path, will be visible in your network.

  1. Go to the VirtualBox and VirtualMachine settings and click on "Shared Folders" Tab, Then Click on the "Add folder" and select your desired path (as depict below), If you want write permission on virtual machine, do NOT mark first check mark.

VirtualBox Shared Folders Setting

Then click on "OK". and start your virtual machine.

In Computer2 (VirtualBox -> Windows):

Open a new CMD and execute the following:

net view

You will be able to see Computer1 (Ubuntu / Linux) as depict below

net view in cmd

Then, you can use the following command in CMD to using Network Space as a Drive on Windows :-)

net use x: \\SMSS-NETWORK\Public1

net use in cmd

Then, in your MyComputer window you will see X: drive as depict below:

MyComputer window

You can remove it by right click on it and select "Disconnect" option.

Be lucky :-) Feel free to contact me and ask to any clarification :)

Salehi
  • 569
  • i would like to appreciate ur answer but i want to know how it will be done in virtual box when i install ubuntu in virtualbox and main os is windows 7 – Balaji Balu Sep 08 '14 at 03:36
  • Does NOT matter "which is virtual" & "which is baremetal", This is network concept, just replace your machines IP. – Salehi Sep 08 '14 at 12:56