User Tools

Site Tools


other:samba-connection

Connection between Windows and Linux machines through a Samba server

Connecting to a Linux machine through Windows 7/10

Samba should work out of the box on new (as of January 2020) images of Ubuntu Mate provided by the myCNC team. Use the steps below to set up a Samba server manually.

Linux configuration

1. Install Samba on your Linux machine if it is not already installed. To do so, open Terminal and type in the following command:

sudo apt install samba

Enter Y (for Yes) when prompted, the installation should begin shortly:

2. If you want to have a password protecting the folder that will be accessed through the network, you can create a Samba user and assign a password to that username. From there on, in order to access the folder from other machines, you will need to type in the username and password specified here (if you do not require to have a password, you can skip this step).

In Terminal, type in the following command:

sudo smbpasswd -a mycnc

Here, mycnc is the username that we have chosen, as there is already an account on this machine with such a username. You can choose any username you require. The program will prompt you to enter a password, and then to confirm it:

3. We want to allow access to the DNC catalog which typically contains G-code and DXF files for the myCNC application. In order to do that, we have to define the path to that catalog in the Samba config file. In order to open this file, type the following line into the Terminal:

sudo pluma /etc/samba/smb.conf

Pluma is the editor of choice in this particular example, as it comes bundled in with Ubuntu. You can use any text editor you find suitable.

After the file has been opened, scroll down to the bottom. There should be a block of code that looks similar to the following:

[Share]
   comment = DNC
   browseable = yes
   read only = no
   path = /home/mycnc/DNC
;  valid users = mycnc
   public = yes
   available = yes
   writable = yes

This block can be called Share, DNC, or any other name. This name will later be used in Step 8.

Edit the code in the text file until it looks like the code above. If you have created a username and password in Step 2, remove the semicolon which comments out the valid users line and edit the username from mycnc to the one you have chosen in Step 2. If no username was created, or if you want to proceed without a password, leave the line commented out. After you are done, save the file and close the text editor application.

4. The DNC folder needs to have specific permissions so that we can read, write and execute files from it. In order to give it those permissions (if they are not given already), type the following command into the Terminal:

chmod 777 /home/mycnc/DNC

Note that the path to folder can be changed if you are using some other folder, or have moved DNC to some other location. The permissions that are given to the folder in this step are already included on the latest build of myCNC Ubuntu Mate LiveCD, so this step is not necessary in all cases.

5. You can now reload the Samba process by typing the following line into the Terminal:

sudo service smbd restart

This step completes the setup on your Linux machine.

Windows configuration

6. Switching over to the Windows machine, go to the File Explorer and right-click This PC button (Computer on the Windows 7 version). Select the Add a network location option:

7. Click Next in the popup window, and then select the Choose a custom network location option:

8. In the next window, enter the IP of your Linux machine, similar to the following:

\\192.168.0.121\Share

You can find the IP of your Linux machine by going into the Connection Information window, or by typing

hostname -I

into the Terminal.

Note that the Share part is present here because that was the name of the code in the text file in Step 3. If the name was changed in Step 3 (for example, to DNC), use that changed name instead.

9. Next, select a name for the shortcut that you will be using:

This should complete the setup process on the Windows side. Now, the DNC folder should be shared, and can be used to transfer the files from a Windows 7/10 machine onto a Linux machine running the myCNC application.

other/samba-connection.txt · Last modified: 2023/04/14 08:59 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki