LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-04-2014, 08:04 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Transform my Linux Notebook as an USB Samba Pendrive??


Hello,

I have a Windows 8 PC that as several usb ports. I run on it Windows, and I have no admin rights at all. I have a vaio mini that runs debian linux (I have all rights).

The aim would be to let the window machine see the files over the usb cable which would be plugged to the vaio mini.

I would like that the vaio mini runs a samba and offer this samba network to the windows 8 machine.

I know it is possible since my zaurus could also give a samba for file access over usb without having the need of admin password for the windows.

any ideas?

sincerely yours.


what about:

method 1:
please keep in mind that I have no rights to install anything or configure an additional networking usb device ip stuffs, since just user rights on the windows machine:
Code:
> /etc/hotplug/usb: > > #!
 /bin/bash > # /etc/hotplug/usb/usbdnet > # > typeset -i num > num=`ifconfig
 | grep usb0 | wc -l` > if [ $num -eq 0 ] ; then > ifconfig usb0
 192.168.129.1 netmask 255.255.255.255 up > route add -host 192.168.129.201
 usb0 > fi > iptables -t nat -F > iptables -t nat -A POSTROUTING -j SNAT -o
 eth0 --to 192.168.0.XXX > echo 1 > /proc/sys/net/ipv4/ip_forward > > (where
 192.168.0.XXX is local ethernet IP address on my desktop machine) > > The
 basic sync functionality, including local VNC, ssh, etc, > connections,
 only sets up basic host routing between the Z and your >


   just connect the USB cable (USB mini-B into Zaurus, USB A into Laptop or
   PC). The Windows machine should detect a new device at this point, a SL
   series Ver3 (NDIS 5) network adaptor, and you should be able to configure
   it. By default, the Zaurus would be assigned an IP address of
   192.168.129.201. Assign an IP address in the same range to this new
   network adaptor, eg 192.168.129.101. You should now be able to ping both
   ways unless you have a firewall blocking it or DDE service is not enabled.
   If you want the Zaurus to be able to access the internet as well, you
   could enable internet sharing on your Windows PC (assuming it has internet
   connectivity and you trust Microsoft security). If you do that, Windows
   will reset the IP address of your Zaurus NDIS driver to 192.168.0.1 but
   you can change it back to whatever value you had given it before, ie
   192.168.129.101 On the Zaurus side, you need to run the following commands
   to setup a route to your windows box:
   +-------------------------------------------------------------------------------+
   | # su | | # route add -host 192.168.129.101 usbd0 | | # route delete -net
   192.168.129.0/24 usbd0 | | # route add default gw 192.168.129.101 |


method 2:
another way would be to create an image img file and to share it via usb over g_file_storage, but well this is onto a image img file.
Creating an image is very simple and works well over the g_file_storage. However I would like to really sharing files without the need of image file, simply whole real files located on the vaio linux partition.
Code:
I would like that the file sharing of my vaio is really from the /home or whatever files that are located onto the harddisk /dev/sda2, without having to trick or work-around with an image. 

example of idea over image file, but me, I would like to write directly on the partition having linux without the image need.
         g_filemounter( 1 , " lsmod | grep g_file_storage ", " cd ~/documents/cdroms ; sudo modprobe g_file_storage    removable=1     stall=0   file=disk-gadget.img " , " sudo rmmod g_file_storage "  );


the method 3 consists to use the g_mass_storage
it is a nice way since the sda3 could be ntfs and be read/write from the windows. HOWEVER!!!, it cannot be worked on it at the same time by hte windows and the vaio machines.
One machine can mount it at a time to avoid data corruption.
So this is why I came to the idea of creating a sort of samba that could be really accepted by all whatever windows 7,8 or xp that does not ask you to install any driver or install any other whatever. but I do not know how actually...
modprobe g_mass_storage file=/dev/sda3

Last edited by Xeratul; 04-04-2014 at 08:38 PM.
 
Old 04-05-2014, 01:27 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Wouldn't the easiest way be to use a USB/ethernet dongle on the Linux laptop (assuming it doesn't already have an ethernet interface), and use that in conjunction with Samba?
I've never heard of IP over USB, and even if it exists, the cabling and other complexities surrounding multiple USB host boxes just seems like a waste of effort.

Wouldn't it be nice if there was a decent solution for a Windows hosted NFS client? Sigh...
 
Old 04-05-2014, 01:45 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
So you can't share via samba over ethernet?

A quick search did not provide any evidence that the laptop has a OTG port.

The zaurus has a host or OTG port which lets devices like cell phones, cameras, MP3 players or tablets etc connect to a PC. In a nutshell USB is a master / slave protocol for lack of better terms. The PC is the master and the host USB port controls the connected devices. The USB ports on a mouse or keyboard are designed as devices ( or slaves in my anology). So you can not connect to host controllers directly together.
So typically desktops and laptops only have host ports so you can not directly connect them together without a special USB cable (i.e data transfer cable).

Basically a data transfer cable in this mode would setup a network between the two devices just like ethernet. I would see no advantage in using USB over standard ethernet.
 
1 members found this post helpful.
Old 04-05-2014, 06:35 PM   #4
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
If both computers are networked you could always run a ssh server (for sftp) or a samba server on the vaio mini.
 
Old 04-05-2014, 08:22 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Not sure you need admin to share a folder do you on windows 8?
 
Old 04-06-2014, 01:15 AM   #6
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
If you don't have admin rights then perhaps you should ask the owner of the Windows 8 machine to give you admin rights? I hope that it's just a work machine and you're trying to breach your contract rather than this being a stolen machine.
 
Old 04-06-2014, 05:01 AM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Samba is more of a network protocol, so why not use the network? Lots of means to share data with windows from linux over a network. You could use usb to ethernet devices x2 + ethernet cable (crossover?). Or bridge gaps with actual pen drives. Your camcorder, cell phone, watch, mp3 player, and every other device on the market seems to double as usb storage these days. So a netbook seems a bit overkill for that purpose.
 
Old 04-06-2014, 12:47 PM   #8
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
Quote:
Originally Posted by jefro View Post
Not sure you need admin to share a folder do you on windows 8?
Run the server on the Vaio. Pick either samba or ssh. The client is on Windows 8 so you should not need admin.

One other option for a quick transfer is woof. You will just need the IP address of the Windows PC.

Last edited by propofol; 04-06-2014 at 08:54 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install Linux using USB flashdrive/Pendrive arunDVM Linux - General 7 07-21-2013 08:05 AM
Linux VMware image on USB 3.0 pendrive possible ? sunzeal Linux - Newbie 9 05-18-2013 04:48 AM
linux can't boot from dvd/cd nor usb-pendrive padr Linux - Hardware 1 12-07-2008 12:22 PM
installing linux from a USB pendrive instead of a cd cdom Linux - Newbie 5 05-04-2008 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration