Announcement

Collapse
No announcement yet.

Connect your Android phone to your Samba server.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Connect your Android phone to your Samba server.

    A while ago I asked a general question on how to save my photos while on holidays to my server due to the restricted free storage space on my phone. My phone has maybe 100 GB of free space while my server has TBs. After considering the replies to my earlier post I decided on setting up a WAN so my Android could talk directly to my server and upload all the photos and videos there. My situation was one where I had an existing Samba server that was used exclusively on a LAN.

    I had previously set up OPENVPN but rarely used it as it was so slow. After an upgrade to KUbuntu at some point it broke and it was just to much trouble to fix so I worried that reinstating it for Android access would be a real PITA. After some research I decided on connecting my Android to my Samba server using Wireguard. To say that this was simplicity plus to do is an understatement.

    Here are the steps to get it going:
    1. Install Wireguard server. Some guy, hwdsl2​ has created a brilliant install script for setting up your server. Download the below Wireguard link and follow the instructions, no need to separately download Wireguard for your server.
    2. Install Wireguard on your Android from the Google Play Store (works on rooted phones). The script above also generates a QR code (in your server's terminal) which you scan from the Android Wireguard app to complete a working connection.
    3. Setup your router's port forwarding or virtual server functions to allow port 51820 (default) to be piped to your Samba server. (Make sure you enable UFW)
    4. Install an app on your Android to talk to your samba server, in my case I used CIFS Document Provider -
    https://play.google.com/store/search...rovider&c=apps (I know the picture is in Chinese but it works in English on your phone.)
    To use this app turn on your Wireguard connection first and it is simply a matter of pressing the connection button followed by the browse button to find your Samba share. The browse button will only display those shares you have setup for this connection in samba.conf.

    In terms of time getting Wireguard and CIFS Document Provider installed and talking to each other is really only about 5 minutes. Setting your UFW rules maybe 30 minutes (need to identify ports numbers and protocols), for example KDE connect needs a UFW allow rule plus a few more depending on what connects to your server. Setting your router's forwarding is about 5 minutes and samba can be relied upon to take a long time. I tried being fancy and wasted 6 hours before I decided on a separate share for the Android connection. In total, excluding Samba.conf the whole shebang in less than an hour.
    WireGuard VPN server installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS, Fedora and openSUSE - GitHub - hwdsl2/wireguard-install: WireGuard VPN server installer for Ubuntu, Debian, AlmaLi...
    Last edited by shag00; Dec 20, 2023, 04:10 PM.

    #2
    Thank you... I don't have your use case but it's good to know "To say that this was simplicity plus to do is an understatement". OpenVPN broke for me on Kubuntu with 22.10 which is a problem for me as my work is all in with OpenVPN; my workaround is to downgrade to a working version, but that must be fragile. I am encouraged to push for Wireguard.
    Regards, John Little

    Comment


      #3
      i have kuuntu 22.04.3LTS 64 bit i did this in termanal sudo apt-get istall samba got this,e: installed samba-common-bin package post-installation script subprocess returned error exit stat 1 i havent posted to forums in years so sorry if i did something wrong i think i found the issue samba was trying to install in a nonexisting directory!
      Last edited by spirithawk; Jul 22, 2024, 10:27 AM.

      Comment


        #4
        I would suggest you purge samba from your system and start again and install Samba from the Ubuntu repository.

        Comment


          #5
          Originally posted by shag00 View Post
          I would suggest you purge samba from your system and start again and install Samba from the Ubuntu repository.
          how would a person using kubuntu select the ubuntu repository
          Last edited by spirithawk; Jul 22, 2024, 10:35 AM.

          Comment


            #6
            Yes, it is not crystal clear, so to clarify:

            Code:
            sudo apt-get install samba​
            You do not select a repository to use, you identify and then add repositories that contain data you want to your system then just use apt to install the program you want. Apt searches the repositories you have in your system for the program you requested. The repository containing Samba should be already installed in your system.

            Comment


              #7
              Originally posted by spirithawk View Post
              i have kuuntu 22.04.3LTS 64 bit i did this in termanal sudo apt-get istall samba got this,e: installed samba-common-bin package post-installation script subprocess returned error exit stat 1 i havent posted to forums in years so sorry if i did something wrong i think i found the issue samba was trying to install in a nonexisting directory!
              so i would do sudo apt autoremove samba and how would i tell apt to use ubuntu repository

              Comment


                #8
                You've missed the point I was making, you do not choose the repository per se to install software. KDE chooses the Ubuntu repository because when you identify the program by name KDE searches through the preinstalled and manually added repositories in your system located at /etc/apt/sources.list.d/ and /etc/apt/sources.list~. Not all Ubuntu repositories are preinstalled but the one with Samba in it is.

                BTW it's sudo apt remove samba not autoremove.

                Comment


                  #9
                  i do this now sudo apt-get install samba what changes do i need to make to get it from the ubuntu repository

                  Comment


                    #10
                    If you have not edited your /etc/apt files mentioned above, nothing. Just just use apt install.

                    Comment


                      #11
                      Originally posted by shag00 View Post
                      You've missed the point I was making, you do not choose the repository per se to install software. KDE chooses the Ubuntu repository because when you identify the program by name KDE searches through the preinstalled and manually added repositories in your system located at /etc/apt/sources.list.d/ and /etc/apt/sources.list~. Not all Ubuntu repositories are preinstalled but the one with Samba in it is.

                      BTW it's sudo apt remove samba not autoremove.
                      you aretalking about going to the settings section in discover all need to know that i install many apts from terminal if i change to ubuntu repositorys in discover i wouldnt get kubuntu updates

                      Comment


                        #12
                        Originally posted by spirithawk View Post
                        if i change to ubuntu repositorys in discover i wouldnt get kubuntu updates
                        Not true.
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          I have no idea WTF you are on about. What I have written is plain and simple, there is no point continuing this discussion.

                          Comment

                          Working...
                          X