Python Forum
How to access shared folder on Windows from Ubuntu machine
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access shared folder on Windows from Ubuntu machine
#1
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.
Reply
#2
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.
Reply
#3
Yes, I installed it.
What then ?
I've tried to mount shared folder using IP address of windows machine, but it failed.
Reply
#4
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
Reply
#5
(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
Reply
#6
What is the path of the shared folder on the windows host?

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

Tried with password and username. The same.
Probably I should also specify the path to shared folder, i.e. \\SARATOGA\pdf2 ?
Reply
#8
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.
Reply
#9
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.
Reply
#10
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Python3.X] [Windows] Remote Registry Access (like WMI or other) ManuHry 1 3,783 Jun-19-2018, 03:27 PM
Last Post: Larz60+
  Copy data from 1 blk device in machine A to another blk device in machine B AbhishekV 2 3,399 Feb-01-2018, 11:40 AM
Last Post: DeaD_EyE
  paramiko/ssh-matic not working from Windows Server 2012 R2 machine having Python34. pythonuser14 1 3,237 Oct-15-2017, 06:53 AM
Last Post: pythonuser14

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020