ynetshares-0.9 - yad gui to mount network shares

Moderator: Forum moderators

Post Reply
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

ynetshares-0.9 - yad gui to mount network shares

Post by plinej »

Here's a simple yad gui for mounting/unmounting network shares. You will need yad, nmap, and smbclient installed to use this. Run the gui from the network menu and it will scan your network for any shares. If shares are found you'll be able to select what you'd like to mount. If you successfully mount a share you'll be prompted to unmount when you run the program again.

ynetshares.png
ynetshares.png (12.72 KiB) Viewed 104 times

0.2 minor improvements
0.3 added option to rescan and if arp is installed the first, third, fifth, etc... rescan will use arp instead of nmap to find local ip addresses. I also added a yad tail viewer that will display smbclient checking the found ip addresses for shares.
0.4 I decided to speed the process. When initially searching for shares the program will try to ping your existing saved shares and if online you will be prompted to mount them. If you select rescan then nmap will run and search for all local ip addresses like normal. I'm guessing most people are like me and really only mount the same network share/shares so there's no need to run nmap every time.
0.5 used mktemp for the temp file and fixed a couple of commands that might print errors. I also edited a few of the buttons.
0.6 sped up some processes and created a manual entry option
0.7 added option to re-scan all IP addresses without host names for shares
0.8 the program will unmount a mounted network drive when the host is down
0.9 bugfix

ynetshares-0.9.pet
(7.33 KiB) Downloaded 15 times
Last edited by plinej on Wed Mar 27, 2024 5:44 pm, edited 8 times in total.
You can download my packages at https://archive.org/download/plinej-packages
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.2 - yad gui to mount network shares

Post by plinej »

0.2 is up

You can download my packages at https://archive.org/download/plinej-packages
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.3 - yad gui to mount network shares

Post by plinej »

0.3 is up

You can download my packages at https://archive.org/download/plinej-packages
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.4 - yad gui to mount network shares

Post by plinej »

updated to 0.4

You can download my packages at https://archive.org/download/plinej-packages
User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 87 times

Re: ynetshares-0.4 - yad gui to mount network shares

Post by user1234 »

Running the program, I get:

Code: Select all

cat: /root/.ynetshares: No such file or directory

You should add a check at the beginning whether the file is present or not, or even better, simply do:

Code: Select all

touch /root/.ynetshares

EDIT: I see why you may not want to simply touch the file. So, adding a check is a choice; the error occurs at line 159 (since cat is used without a check).


Another thing, you use user and timestamps to generate temporary file, which is not secure. Use the command mktemp instead.

The command also creates the temporary file, so it is secure against race conditions.

PuppyLinux 🐾 gives new life to old computers ✨

plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.5 - yad gui to mount network shares

Post by plinej »

@user1234, thanks for your input. I've posted version 0.5.

You can download my packages at https://archive.org/download/plinej-packages
User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 87 times

Re: ynetshares-0.5 - yad gui to mount network shares

Post by user1234 »

@plinej, I also was not able to get this working in Jammy64 running in QEMU environment. I can access my samba service if I manually connect to my service with these commands:

Code: Select all

sambashare //192.168.205.204/sambashare -U=lakshay

Code: Select all

mount -t cifs //192.168.205.204/sambashare ./sambashare -o user=lakshay

But, ynetshares only returns with "No shares found".

My IP address in QEMU: 10.0.2.15.

Maybe, it is because my QEMU and my Host are not in the same local network?

However, QEMU does not have a separate network connection.

Here is ifconfig's output from (i) Host:

Code: Select all

enp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b4:b6:86:df:50:a7  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 23372  bytes 2444837 (2.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23372  bytes 2444837 (2.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:2b:a0:b6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.205.204  netmask 255.255.255.0  broadcast 192.168.205.255
        inet6 fe80::69a7:c5c9:2473:afba  prefixlen 64  scopeid 0x20<link>
        inet6 2402:3a80:41c2:2e73:2df9:2806:80d4:21a2  prefixlen 64  scopeid 0x0<global>
        inet6 2402:3a80:41c2:2e73:c074:9f3c:1d96:5988  prefixlen 64  scopeid 0x0<global>
        ether 94:b8:6d:6e:31:74  txqueuelen 1000  (Ethernet)
        RX packets 24112  bytes 15727492 (15.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 76121  bytes 8155872 (8.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(Here, wlp2s0 is my running network device.)

(ii) QEMU:

Code: Select all

ens3      Link encap:Ethernet  HWaddr 52:54:00:12:34:56
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fec0::bcc6:2e89:397b:5f4a/64 Scope:Site
          inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
          inet6 addr: fec0::5054:ff:fe12:3456/64 Scope:Site
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:441 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:57092 (55.7 KiB)  TX bytes:42274 (41.2 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

(Here, ens3 is my running network device.)

PuppyLinux 🐾 gives new life to old computers ✨

plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.5 - yad gui to mount network shares

Post by plinej »

@user1234, yes it's because it's not in the same local network. I've never used QEMU but I assume you'd need to find the IP address on your Host device and then manually connect. I could add a manual configuration option that could be saved and edited if/when the local IP address changes.

You can download my packages at https://archive.org/download/plinej-packages
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.6 - yad gui to mount network shares

Post by plinej »

updated to 0.6

You can download my packages at https://archive.org/download/plinej-packages
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.7 - yad gui to mount network shares

Post by plinej »

updated to 0.7

You can download my packages at https://archive.org/download/plinej-packages
plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.8 - yad gui to mount network shares

Post by plinej »

updated to 0.8

You can download my packages at https://archive.org/download/plinej-packages
Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: ynetshares-0.8 - yad gui to mount network shares

Post by Clarity »

Hello @user1234 and @plinej

QEMU accesses the host's sharelist over IP 10.0.2.2. File/folder movement can occur between the host and the VM via mount or samba services. For example, via the command smbclient -U% -L 10.0.2.2

Of course, the host MUST have its SAMBA started.

For ynetshare could detect if it is being used in a QEMU VM by a filesystem search. For example this shows

neofetch.jpg
neofetch.jpg (31.99 KiB) Viewed 122 times

@plinej would you be willing to put a sample screenshot of the ynetshare GUI in your opening post of this thread?

Enjoy

plinej
Posts: 236
Joined: Thu Jul 16, 2020 1:39 am
Has thanked: 6 times
Been thanked: 98 times

Re: ynetshares-0.9 - yad gui to mount network shares

Post by plinej »

0.9 is up. I found a bug and fixed it.

You can download my packages at https://archive.org/download/plinej-packages
Post Reply

Return to “Network”