How can I share a hard drive from Kodi to my laptop?

Hi there,

I live in school housing, so I don’t control my own internet network. I have an old Apple TV running OSMC that I use for music and TV in my room. I have an external hard drive with all of my media on it, but it is a pain to connect it to my computer and Apple TV all of the time.

I used to connect the portable hard drive to my laptop directly and then shared the hard drive over Windows SMB sharing to the Apple TV. The trouble is, with the way the university’s network is setup, every time I reconnect my laptop to the WiFi, the IP address of my laptop changes, so I need to enter the new IP address on my Apple TV to connect to the hard drive, which is a pain in the ass.

I want to be able to access the portable hard drive from my OSCM device and my laptop at all times without needing to enter the IP address every time. My Apple TV is connected via ethernet, so the IP address will be static, hence,

tl;dr my thought was to connect the hard drive to the Apple TV directly and then share the drive over the network so I can access the drive at any time and any place as a network drive with my laptop.

Is that possible? Can I share an entire drive from a OSMC device back to my laptop? It’s an odd thing to do, I know. Not many threads on this topic. Let me know if you have any ideas. Thanks!

Yes, just install Samba Server from App Store and then you can connect from your PC via SMB protocol.

Trying this now, thank you!

Is there a guide for setting up Samba and connecting with my laptop? I was able to download the app from the app store but there were no instructions on how to configure it and connect to it.

I believe I have Samba up and running on OSMC, but how can I create a connection on my laptop?

Just mount it as a network drive.

Browse in the Windows file manager to

\\<ip-of-atv>\<name-of-share>

I can find the IP address of the Apple TV and I know what that is, but what would be the name of the share? Is it the name of the hard drive? How can I find what the name is?

By default it will be the name of the folder in /media

Or on the ATV you can run smbclient -L <ip-of-atv> to list them.

So in Windows Explorer I am entering

\\ < ip address of atv >\media\My Passport

But Windows cannot connect to it.

Also, how do I run that terminal code on OSMC?

SSH to your ATV and type the code at the command prompt.

Accessing the command line is covered at Wiki - OSMC

Okay, thank you, so I was able to bring up to command prompt, but when I input smbclient -L <ip-of-atv>, the command prompt tells me that the command was not found. Any ideas?

Access the command line and run:

sudo apt-get install smbclient

that installs the client software, then you can run yknivags command

Trying this now, thank you, I’ll report back!

Alright, so I was able to install smbclient. I am sorry I didn’t have that before, I thought I did. It is installed now. I ran smbclient -L <ip-of-atv>. I see that I have a sharename of osmc and another one called IPC$. I put \\<ip-of-atv>\osmc into WIndows Explorer and I still do not have access to the drive.

Did you ever reboot the device since installing samba server?

Yes I have. I rebooted a couple of times and then again after installing smbclient.

try this in command line:

mount -l | grep /dev/sd

to see where in the filesystem your hdd is mounted, seems like it isn’t in /media or else the autoshare would kick in

Okay, I tried that line and got

/dev/sda1 on / type ext4 ...
/dev/sda2 on /boot type hfsplus ....

So the drive that the system boots from is at /dev/sda2 and another drive (probably the internal hard drive) is at /dev/sda1?

Are you entering this exactly as it is here or are you actually substituting in the IP address of your AppleTV?