Python Forum

Full Version: How to access shared folder on Windows from Ubuntu machine
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello,
How to access the conetnt of a shared folder on Windows from Ubuntu machine ?
Transfer isn't need, only read acces and probably file rename.
Thanks.
I haven't done this for a long time but it seems to me that you install samba and there is a command to mount the folder.

Looking in some very old notes, I have a command line to mount the shared C folder from host 192.168.2.4

Output:
sudo mount -t cifs 192.168.2.4:C -o password="" /mnt/foobar
You need to create the folder /mnt/foobar first.
Yes, I installed it.
What then ?
I've tried to mount shared folder using IP address of windows machine, but it failed.
see my edit above. You can have the ip address of host foobar by entering
Output:
nmblookup foobar
or perhaps from python
>>> import socket
>>> socket.gethostbyaddr('foobar')
Also make sure package cifs-utils is installed and you can read
Output:
man mount.cifs
(Nov-09-2019, 02:57 PM)Gribouillis Wrote: [ -> ]I haven't done this for a long time but it seems to me that you install samba and there is a command to mount the folder.

Looking in some very old notes, I have a command line to mount the shared C folder from host 192.168.2.4

Output:
sudo mount -t cifs 192.168.2.4:C -o password="" /mnt/foobar
You need to create the folder /mnt/foobar first.
Here is output when I execute the instruction above:

mount.cifs: bad UNC (192.168.0.1:C)

where 192.168.0.1 - is wired IP of Windows machine
What is the path of the shared folder on the windows host?

also you may need username="ham",password="eggs" after the -o
\\SARATOGA\pdf2

Tried with password and username. The same.
Probably I should also specify the path to shared folder, i.e. \\SARATOGA\pdf2 ?
Then try 192.168.0.1:SARATOGA/pdf2 or something similar. There must be a correct syntax to name the volume.

It is essential that you specify the path of the shared folder. In my example the shared folder was the whole C drive, hence the C.
Tried as you suggested with two version of slash, i.e. '\' and '/'.
The same.

I checked Windows machine from Ubuntu with ping and it's Ok.
Isn't SARATOGA a subfolder of a windows volume such as C: or E: ? You probably need to include the name of the volume in the path.
Pages: 1 2 3