Local Network file sharing using Windows 10 and Ubuntu
Tags: tutorial, linux, windows, python
Published: 2022-06-15 22:23:49

**What is a Windows workgroup?**
Windows workgroup is a collection of computers on a local area network (LAN) that share resources and responsibilities. Workgroups provide easy sharing of files, printers, and other network resources. Being a peer-to-peer(P2P) network design, each workgroup computer may both share and access resources if configured to do so. We will be using a Windows workgroup to share folders on a network. These folders will then be accessible using Ubuntu by connecting to the workgroup IP.

1. Create a folder you would like to share. I'll be creating a folder named `shared-folder-kenji` in the `C:` drive. Once created, right-click on the mouse and  select `Give access to -> Specifc people`.
![Access](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4dcqvseh4hlvzbg3yrjy.png)

2. A pop-up box will appear asking who you would like to share the folder with, and make sure to select `everyone`
![who?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg7gwsj7ug7rm451mm1g.png)
Public Network discovery will be turned `ON` to allow other machines to discover the windows host machine. 
![discover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7z46u372xutuj7uzx4a.png)
![2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jk88jinv4e9qr9jfztkn.png)
![3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4985g7293iwsfozvt6m7.png)

3. Now, to access this folder on Ubuntu, we will need the local IPv4 address of the Windows machine. To find the IP, we need to open up CMD and type the following command. `ipconfig /all`
![cmd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wcebccojo56wpy1e80w.png)
![IPv4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wqmmqnvi15fkur7d777u.jpg)
The local IPv4 address of this machine is `192.168.1.144`.

4. Now let's head over to our Ubuntu machine, open up the `Files` application, select `other locations` on the left tab. You should see `Connect to Server` at the bottom of the page. This is where the Windows IP will go. So mine would look something like this. `smb://192.168.1.144/`
![connect to server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebnmr9s1a8fthcy40p0b.png)
Once you press enter, another dialog will pop up prompting the windows username and password. Specify both and press enter, BOOM! You should see the shared folder.
![Username and password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/um4mlltflvwcfcwkx70n.png)
![shared](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06y72x1rpdy555vdyna5.png)

5. Now once you go inside the main folder there won't be anything, unless of course you moved some files into that folder. But since mine doesn't have anything, let's create python script that prints "Hell World!". First I will create a new folder named `shared-folder-kenji-> ubuntu-shared`, once inside I will open the terminal by selecting `open terminal` with the rick-click mouse menu. Once Terminal is open, I'll run the `nano` command to edit text. Then we'll write out the following, `print ("Hell World")`, `Ctrl+o` to save, then `Ctrl+x` on the keyboard to exit Nano.
![hello world](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwhws2ycv1erier9jmot.png)
You can check if the contents were saved by using the `cat` command in the terminal. `cat hello-world.py`, It should look something like this. 
![Hello world](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pit6v1lg80rccmhan670.png)

6. Back to our Windows machine, we can see that the `hello-world.py` file was captured.
![Window machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7yrjken8bndgyqt6xq4.png)
It's a very simple but affective way for sharing folders with lower end Windows and Ubuntu users. 

Thanks for reading.
Kenji