Results 1 to 5 of 5

Thread: How to connect to shared foled on win10 pc automatically?

  1. #1
    Join Date
    May 2020
    Beans
    10

    How to connect to shared foled on win10 pc automatically?

    Hi!
    Here is what I try to do on Lubuntu latest ver.:
    When I open Caja and click to "Browse Network" then to the desired pc where are my folders shared on windows I have to log in.
    Then everything is fine.

    Here is how I do the command from terminal, but I wish to do that on boot time:
    sudo mount -t cifs -o username=xxx,password=xxx //192.168.0.100/temp //home/lubuntu/mnt/winshare/

    So, how can I achieve this on boot up time when Lubuntu is booting up but without to do the login etc. manually by me?
    Maybe a better solution for me would be to mounting through schedule task manager like When.
    But I again stumbled into a problem to enter the pass for sudo...

    btw. I don't care about the security cos the pc is not on the Internet, and this is just for learning purpose.

    Thank you.
    Last edited by chrisnk; 2 Weeks Ago at 12:42 PM.

  2. #2
    Join Date
    May 2007
    Beans
    194
    Distro
    Xubuntu

    Re: How to connect to shared foled on win10 pc automatically?

    A line in the file /etc/fstab is your answer.

    Like so:
    Code:
    //servername/sharename  /media/windowsshare  cifs  username=msusername,password=mspassword,iocharset=utf8,sec=ntlm  0  0
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  3. #3
    Join Date
    May 2007
    Beans
    194
    Distro
    Xubuntu

    Re: How to connect to shared foled on win10 pc automatically?

    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  4. #4
    Join Date
    Dec 2009
    Beans
    6,383

    Re: How to connect to shared foled on win10 pc automatically?

    sudo mount -t cifs -o username=xxx,password=xxx //192.168.0.100/temp //home/lubuntu/mnt/winshare/
    In /etc/fstab that becomes:
    Code:
    //192.168.0.100/temp /home/lubuntu/mnt/winshare cifs username=xxx,password=xxx,uid=1000 0 0
    Do not use sec=ntlm. If your Win10 machine is up to date it will have no idea what that means.

    Notes:

    Most Linux desktop systems mount things in fstab before the network stack is functional at boot resulting in the cifs mount being attempted before it's able to connect to anything. A way around this problem is a systemd automount. To do that:

    [1] It's best to have a mount point outside your home directory or under /media so I would suggest something under /mnt:
    Code:
    sudo mkdir /mnt/winshare
    [2] If your share is mounted unmount it. If you managed to mount it manually unmount that:
    Code:
    sudo umount /home/lubuntu/mnt/winshare
    [3] Then the line in fstab would look like this:
    Code:
    //192.168.0.100/temp /mnt/winshare cifs username=xxx,password=xxx,uid=1000,noauto,x-systemd.automount 0 0
    [4] Run the following commands to make systemd happy:
    Code:
    sudo systemctl daemon-reload
    Code:
    sudo systemctl restart remote-fs.target
    Now go to /mnt/winshare to verify its contents.

    A systemd automount mounts on contact ( when you access the mount point ) not at boot.

  5. #5
    Join Date
    May 2020
    Beans
    10

    Re: How to connect to shared foled on win10 pc automatically?

    webaake:
    Thank you so much for the nice link and explanation.

    Morbius1:
    Thank you very much for your very valuable writing and explanation.

    You helped me a lot, your writing helped me to solve my problem.
    It is working like a charm and I learned so much new.

    Thank you very much!
    My best regards.
    Chris.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •