Network FAQ

From Knoppix Documentation Wiki
Revision as of 09:28, 17 October 2008 by Clinton (Talk | contribs)

Jump to: navigation, search

Q: How do I get my DSL to work that already works on my windows xp in California?

A: the following instruction should work: (German)

Alternate method, by a noob---for Knoppix 5.1.1 I don't claim to be an expert, but this worked for me!  :-) (All these steps may not be necessary, but it worked for me-YMMV.)

  • From the Knoppix taskbar icon, -configure networking
-try 'yes' to autoconfigure  (This didn't work for me.  No idea why.)
  • If the network interface card is correctly configured, you should see BOTH the loopback interface AND a local network address. It takes up about 15 lines. If yes, you're golden, if not..
  • From another machine on the network, log on to the router. (Look at the instructions that came with your router for how to do this.) In my Siemens SpeedStream 2614 4 port DSL/Cable Router, the location is and after logging in, the opening page shows the following:

INTERNET Cable/DSL : CONNECTED WAN IP: 74.68.xx.yyy Subnet Mask: Gateway IP: 74.68.ff.ggg DNS:

In 'Simple Setup' the allowed range of IP addresses is defined.

  • From your root shell, enter this sequence of commands:
netcardconfig --select 'no' to manually configure the NIC
  -enter an unused IP address in the acceptable range for your router
  -when asked for the following, enter the information from the router:
  -Subnet Mask:  
(I accepted the default,,  and it worked fine.  
Like I said, I'm not an expert!)
  -Gateway IP: (from your router)  74.68.ff.ggg
  -Name server: DNS:   ('Domain Name Server')

to see if network interface card is correctly configured, as above. If not, lather, rinse, repeat. If it is, try

ping   (the IP address of the router above)  and 
ping 192.168.254.xxy   (the IP address of the other machine)
(Hit <CTRL> C   to stop the pinging!)

If this works, you're in!

Q: How to setup the wireless connection using ndiswrapper under Knoppix 4.0.2 & 5.1.1

A: I am not an expert in networking. And I cannot find a centralized area which allows users to record down all the successful cases on using wireless under Knoppix among various hardwares. As a newbie, I spent quite sometime getting a little piece information from one thread and another pieces from other threads. I hope this Q & A can be helpful to other newbies from the pain I had experienced by including a very detail step by step approach. (in other word, it is really long-winded, so be patient)

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling July 2007

I have success on Dell D600, D610 under knoppix 5.1.1. It has Dell Wireless 1450 Dual-Band WLAN miniPCI card with Broadcom BCM43xx chipset.

I also have success on a Compaq n600c with Linksys wpc11 v.4 wireless card.

I don't know how to compile the Linux kernel so I use the ndiswrapper method.

Here are the steps I make my D600 and D610 work:

Assumption: You have wireless running on your windows OS. If not, install the wireless driver and make it works on windows environment first, and then proceed.

More info: I followed the same steps here and tried it on DSL (Damned Small Linux), and it works too.

I did the same test on my Dell D610 with knoppix 4.0.2 based on a request, it works.

I tried the same test with knoppix 5.0.1 and it did not work.

Your windows xp user ID must have the administrator access right

We are going to look for files inside the windows xp system folders, and by default, windows xp set those folders as hidden folders. So you need to open them for view if required.

In order to see the hidden folder, from the windows explorer,

click Tools ==> Folder Options ==> click View tab

==> select Show hidden files and folders

==> unselect Hide extensions for known file types

==> unselect Hide protected operating system files

==> Apply ==> OK

1. Get the windows xp driver files for the wireless card.

1.1 Find out the wireless driver file and it's location.

1.1.1 Open windows explorer => right click on my computer => select properties

1.1.2 Click Hardware tab => click Device Manager button => expand the network adapters

1.1.3 Right click on the wireless network adapter => select properties

1.1.4 Click Driver tab => click Driver Details button

1.1.5 It will display your wireless driver file with the full path. My machine is using c:\windows\system32\drivers\BCMWL5.SYS

1.2 Find out the corresponding inf file.

1.2.1 With Windows explorer open, on the left panel, click on c:\windows\inf folder

1.2.2 Click the "search" button on the tool bar.

1.2.3 Click the "All files and folders" on the left panel.

1.2.4 On the "A word of phase in the file" field, enter "bcmwl5.sys" => click "search" button

1.2.5 On the right panel, it shows c:\windows\inf\oem0.inf

1.3 Now I know the driver files are


and the


2. Copy the 2 driver files to c:\wireless folder

2.1 Create a new folder right under c: drive called wireless

2.2 Copy c:\windows\inf\oem0.inf and c:\windows\system32\drivers\BCMWL5.SYS to it.

I have some old steps here before trying to rename the BCMWL5.SYS to lower case. But after a testing, I found I was wrong and case does not matter when working with ndiswrapper.

3. Find out the ESSID and the channel on the wireless router.

3.1 Log on to your wireless router via internet explorer.

3.2 Find out your network ESSID name, for example: my wireless network ESSID name is "TESTSSID"

3.3 Find out the wireless channel your network is using, for example: my wireless network is using channel 11.

4. With the knoppix 4.0.2 or 5.1.1 on the cd drive, boot up the OS with no cheat code.

4.1 Keep your eyes on the info shown on the screen when the autoconfigurating devices. From both of my machines, knoppix 5.1.1 found two network cards in my machine, i.e. eth0 and eth1. However, my Compaq n600c only have eth0 detected.

For knoppix 4.0.2, only the wired network card (eth0) is found.

4.2 Wait until the knoppix x-window starts and finally you have the knoppix up and running.

4.3 Start the Konsole, i.e. click on the black TV like icon on the task bar. The system console will be up and running (looks like a DOS box)

4.4 Switch to supper user: (i.e. $ is the prompt symbol)

$ su

5. Mount your c: drive to mount point /media/???1 or /mnt/???1

(For knoppix 4.0.2, use mount point /mnt/???1, for knoppix 5.1.1, use mount point /media/???1)

Be careful here, my D600 has the mount point called /media/hda1 but my D610 has the mount point called /media/sda1.

To check the name of the mount point, use the following command: (again, # is the prompt symbol means now you are the super-user or so call "root")

# ls /mnt

It will give back all the name related to your harddisk/partition. (i.e. I have hda1, hda4 and hdc on my D600, hdc is my cd rom, hda1 is drive c: and hda4 is drive d: )

To mount the c: drive to the linux file system, type the following command:

For knoppix 5.1.1

# mount -t ntfs /dev/hda1 /media/hda1 -o ro,umask=000

For knoppix 4.0.2

# mount -t ntfs /dev/hda1 /mnt/hda1 -o ro,umask=000

If your c: drive is not in NTFS format, say in FAT32, you need to use the switch "-t vfat" to replace the "-t ntfs" in the above command. The same idea applies to "/dev/???a" in the command.

Option: I also tried to copy the two driver files to an USB drive first under windows xp and mount the USB drive to linux at this point. It works.

6. Go to the directory where the windows driver files are located.

For knoppix 5.1.1

# cd /media/hda1/wireless
# ls

For knoppix 4.0.2

# cd /mnt/hda1/wireless
# ls

the files oem0.inf and BCMWL5.SYS will be shown.

7. Copy the two driver files to the root's home directory

# cp *.* ~

8. Go to root's home directory to see if the files are there.

# cd ~
# ls

You should see the two files are there.

9. Unmount the c: drive mount point. (optional).

I usually don't want the Live CD OS hook up to my harddisk. I only mount them whenever I need them. But it is just the personal taste only. You can skip this part if you want.

For knoppix 5.1.1

# umount /media/hda1

For knoppix 4.0.2

# umount /mnt/hda1

10. Remove wireless driver installed by Knoppix on boot time (optional)

On boot time, knoppix tries it's best to install the right wireless driver on your system. So if you are lucky enough, your wireless should work after the knoppix is up and running.

However, most of the time, it is not the case. As most of the wireless manufacturers does not provide the wireless driver for Linux, knoppix cannot find the right driver to install on boot time. The worst part is (in my case), it recongizes the wireless hardware, and installed a not working driver while on boot time.

If on step 4.1, you see there are two network cards detected (eth0 and eth1) but you have only one wired network card, most likely knoppix already loaded the wireless driver module (in my case, it is the bcm43xx driver). However, this driver module will have conflict with the ndiswrapper network driver we are going to use, so if this is the case, we need to remove the bcm43xx driver module.

Note: it does not happen on my Compaq n600c with Linksys wpc11 v.4 card so this step is required when needed.

The removal of bcm43xx driver here is just for the Dell D600 & D610, or any computer Knoppix recognised it's wireless network card and installed the bcm43xx driver at boot time.

So far only the knoppix 5.1.1 requires this step. If you are using 4.0.2, skip this step and go to step 11.

If your computer using another wireless chipset but Knoppix recognized it on boot time, you have to do the same step here but you need to find out what the wireless driver is. Try to use "lsmod" command and see if you can find the driver installed.

10.1 Check to see if the bcm43xx is there

# lsmod | grep bcm43xx

10.2 If the lsmod command returns some information back, it means the bcm43xx module is installed. Then remove it with the follow command. Else go to step 11.

# modprobe -r bcm43xx

10.3 Check the successful of the command

# lsmod | grep bcm43xx

It should return no entry.

11. Wrap the windows driver to the ndiswrapper module.

11.1 Enter the command

# ndiswrapper -i ~/oem0.inf

11.2 The command will return a couple of lines feedback as

installing oem0 ...
forcing parameter IBSSGMode from 0 to 2

11.3 Check to see the driver is inserted into ndiswrapper

# ndiswrapper -l

11.4 It should say "oem0 driver installed"

12. Install the ndiswrapper module (now wrap with bcmwl5 driver)

12.1 Enter the command

# modprobe ndiswrapper

12.2 Check if the ndiswrapper is installed.

# lsmod | grep ndiswrapper

You should see entries return with ndiswrapper in there.

13. Find out what is your wireless card symbolic name:

13.1 Enter the command

# iwconfig

13.2 My system returns three information back:

lo : no wireless extensions
eth0: no wireless extensions
eth1: IEEE 802.11g ESSID: off/any blah blah blah ...

Here eth0 is my wired network card, eth1 is the wireless card. Be careful your system may return difference name like wlan0 etc. If that is the case, replace eth1 with wlan0 in all the following steps.

14. Set up the wireless network with ESSID and channel

(for example: my wireless network essid=TESTSSID using channel 11)

# iwconfig eth1 essid TESTSSID channel 11

15. Check the result

# iwconfig

You should see the ESSID is set to TESTSSID and also the access point on the second line now has a valid ID.

16. Start the wireless network card

# ifconfig eth1 up

17. Check the result

# ifconfig

eth1 should appear in the result list.

18. Force the DHCP server to generate an IP address to your wireless network connection.

# pump -i eth1

19. Check the result

# ifconfig

The eth1 should have the IP address on the second line.

20. Exit the super user

# exit

21. Finish line

You are ready to go, start the Web browser and now you can surf the internet. Welcome to the wireless world in Knoppix.

Q: How about wireless connection with WEP turns on

A: This is basically identical to the normal setup but instead the WEP protection is turned on from the wireless router.

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling Aug 14, 2007

I tested WEP on one of my old wireless router. I logon to the router via the web browser. Turn on the WEP function, enter the key (i.e. the passphrase).

My wireless router has 4 keys I can enter and key number 1 is the default one to be used. So I ignored the last three keys and only concentrated on the first key.

I planned to enter "abcde" as my key (64 bits) but I have to enter it by hex. So I entered


where hex value 61 is "a" and hex 65 is "e".

For testing purpose, I also changed the ESSID to ISITLAB.

I then followed the exact steps as the normal wireless setup in Knoppix as above except on step 14.

I entered the passphrase in hex with the key switch as well.

# iwconfig eth1 essid ISITLAB channel 11 key 6162636465

And then it works...

Q: How to automate the wireless connection ?

A: Once I have my wireless hardware up and running, the next target is "How to automate the setup process" so I do not need to do it every time.

This is the solution I come up with. The whole idea is to save the configuration to a drive and then add all the setup wireless driver steps into the script.

Once the wireless setup steps are in place, we can automate the process by using the cheat-code

knoppix myconfig=scan

to load the driver at boot time.

The drive can be either an USB thumb drive or the hard drive. I will use an USB drive with the Dell D610 here as an example.

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling Aug 3, 2007

1. Copy the two wireless driver files oem0.inf and bcmwl5.sys to the USB thumb drive \wireless directory.

2. With the USB thumb drive connected to the machine, boot up the Knoppix 5.1.1 from the CD with no cheat-code.

3. Save the configuration to the USB thumb drive:

==> Click the Knoppix icon on the task bar

==> Select Configure

==> Select Save Knoppix Configuration

==> The Create Knoppix Configuration Archive window popup

==> By default, all items are selected except "All files on Desktop"

==> It depends on what your needs here, for me, I just uncheck all items here

==> Click OK

==> Output to the USB thumb drive : /media/sdb1

==> Click OK

4. Mount the USB thumb drive as read/write enable.

4.1 Find the USB thumb drive, enter the following command from the console.

$ ls /mnt

On the Dell D610, the USB thumb drive is /media/sdb1

4.2 Issue the mount command:

$ sudo mount -t vfat /dev/sdb1 /media/sdb1 -o rw,umask=000

5. Edit the /media/sdb1/

Use the editor you like, append the following code to the shell script.

sleep 5
echo "Remove old bcm43xx module..."
modprobe -r bcm43xx
sleep 5
echo "Wrap bcmwl5.sys into ndiswrapper..."
ndiswrapper -i /media/sdb1/wireless/oem0.inf
sleep 5
echo "Install ndiswrapper module..."
modprobe ndiswrapper
sleep 5
echo "Unmount the USB drive..."
umount /media/sdb1
sleep 5
echo "Setup the ESSID and channel..."
iwconfig eth1 essid TESTSSID channel 11
sleep 5
echo "Start the eth1..."
ifconfig eth1 up
sleep 5
echo "Get IP address..."
pump -i eth1

Then save the file and exit. The first three lines are for Dell D600, D610 or any Dell machines using bcm43xx chipset only. So exclude them if you have machine with wireless chipset other than bcm43xx.

6. Shutdown the knoppix and you are done.

7. From now on, boot up knoppix with the cheat-code:

knoppix myconfig=scan

Wireless should be up and running. Start the web browser to test the connection.

Q: How to automate the search for a predefined list of wireless connections ?

A: I have a wireless connection at the office and one at my home. This section help me to use one script to access them all. All I have to do is to enter the cheat-code at bootup time:

knoppix myconfig=scan

This example assumes my office has the ESSID=OFFICE on channel 9 and my home has the ESSID=HOME on channel 11.

All steps are the same as the FAQ "How to automate the wireless connection"

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling 5 Aug 2007

Follow the steps mentioned on FAQ "How to automate wireless connection". The only difference is on step 5.

On step 5, find out the code "iwconfig eth1 essid TESTSSID channel 11"

Replace this line with the following piece of code:

for i in OFFICE HOME; do
  sleep 5
  if [ "$i" = "OFFICE" ]; then
  elif [ "$i" = "HOME" ]; then
    echo "Error on searching network channel"
  echo "Searching for network $i with channel $channel"
  iwconfig eth1 essid $i channel $channel
  sleep 5
  result=$( iwconfig eth1 | grep $i )
  if [ "$result" = "" ]; then
    echo "Network $i channel $channel not found"
    echo "Now check for the next network on the list..."
    echo "Network $i channel $channel found"

Be-aware of the spaces in the code, especially on the if statement. You must type in exactly as how my code looks like. Cut and paste is not a bad idea here.

Save the file.

No matter where you are, at home or at office, just enter the cheat-code at boot time:

knoppix myconfig=scan

should connect your knoppix to the right wireless network.

If you have more wireless networks you want the script search for on the bootup time. (says SALESDEPT, FRONTDESK, ACCOUNTDEPT at work) Just add these networks ESSID to the line as below:


then add the corresponding elif statement block to set the channel number right before the "else" statement.

 if [ "$i" = "OFFICE" ]; then
 elif [ "$i" = "HOME" ]; then
 elif [ "$i" = "SALESDEPT" ]; then
 elif [ "$i" = "FRONTDESK" ]; then
 elif [ "$i" = "ACCOUNTDEPT" ]; then
   echo "Error on searching network"

The machine will search for the network in the order that appears on the "for" statement. Once the first available network is found, it will stop the searching.

So if you want to log on to the SALESDEPT first, if not found, search the FRONTDESK, and then ACCOUNTDEPT and finally OFFICE. Then you have to rewrite the "for" statement as below.


You need to do nothing on the "if-then-elif-else" statement block if you are not adding in new network item. Ordering in there does not matter.

Q: What machines does the Trendnet TEW-424UB Wireless USB adaptor supports ?

A: After a success with the onboard wireless adaptors on all the three laptops I have. I switch to the Trendnet TEW-424UB Wireless USB adaptor and see which machine can use it.

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling Aug 2, 2007

Version: the Trendnet TEW-424UB is version 2 with SiS hardware.

I use the 2 driver files directly from the Trendnet installation CD. I went to \drivers\windows XP directory and copy the SiS163u.INF and SiS163u.sys to c:\wireless folder and then follow the instruction as the above FAQ.

Testing results on various machines: (please append to this list if you can)

Machine: Dell D610 laptop

Result: positive

Machine: Dell D600 laptop

Result: positive

Machine: Compaq EVO N600C laptop

Result: negative

Machine: Compaq DeskPro EN Desktop with 1G Hz P3 CPU

Result: negative

Machine: Compaq EVO Desktop with 2G Hz P4 CPU

Result: negative

Machine: IBM NetVista Desktop 1G Hz P3 CPU

Result: negative

Machine: No Brand Name Desktop with AMD 2G Hz CPU and ECS K7S5A motherboard

Result: positive

Q: How to setup NFS between knoppix machines via NFS ?

A: Here is a step by step approach to show you how to use NFS between 2 knoppix machines. I use Knoppix 5.1.1 in this test and both machines are booted from the knoppix 5.1.1 cd.

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling 1st Jan 2008 (Happy New Year!)

Server machine: Machine boot from the knoppix 5.1.1 cd will act as the server machine, it will open the /testroot directory to all machines within the subnet 192.168.1.*.

Client machine: Machine boot from the knoppix 5.1.1 cd will act as one of the client machines, it will mount the server directory /testroot to it's local mount point /nfsmnt.

Exception Directories Handling: I tried a couple of directories on the server machine following the same steps as the /testroot case but failed.

For example: /ramdisk and /UNIONFS

Here is the error I got when I tried to mount the /ramdisk and /UNIONFS from the client

 $ sudo mount -t nfs /nfsramdisk
 mount: failed, reason given by server: Permission denied
 $ sudo mount -t nfs /nfsunionfs
 mount: failed, reason given by server: Permission denied

The work-around:

I found a work-around to these directories. From the server side, I created two symbolic links under /testroot which point to /ramdisk and /UNIONFS with the identical names.

 $ sudo ln -s /ramdisk /testroot/ramdisk
 $ sudo ln -s /UNIONFS /testroot/UNIONFS

Then when I went through all the steps below, on the client machine, I can always access the server's /ramdisk and /UNIONFS directories by going to /nfsmnt/ramdisk and /nfsmnt/UNIONFS.

1. On the server machine

1.1 Create the directory /testroot and set it to read/write/execute to all users

 $ sudo mkdir /testroot
 $ sudo chmod 777 /testroot

1.2 Create the file /etc/exports

 $ sudo vi /etc/exports

Be careful that there is only one space on the above line.

Save the file.

1.3 Start the NFS related daemons on the server side

 $ sudo /etc/init.d/portmap start
 $ sudo /etc/init.d/nfs-common start
 $ sudo /etc/init.d/nfs-kernel-server start

2. On the client machine

2.1 Start the NFS related daemons on the client side

 $ sudo /etc/init.d/portmap start
 $ sudo /etc/init.d/nfs-common start

2.2 Create a directory /nfsmnt on the client machine as the mount point

 $ sudo mkdir /nfsmnt
 $ sudo chmod 777 /nfsmnt

2.3 Mount the server directory /testroot as /nfsmnt on the client machine

 $ sudo mount -t nfs /nfsmnt

2.4 Done. Now you can access the /nfsmnt mount point as a local directory.

Q: How to setup FTP on Knoppix ?

A: Knoppix has the FTP server up and running when booted. However, because of the security reason, it was locked so that you cannot ftp to the server.

Caution: You have to understand that the FTP is not secure and you may consider using other ftp product instead. (i.e. vsftp is a good choice)

However, for a home-based closed local network, who care? Or if you have the same machine as I have, you do not care too.

My machine: an old Pentium 3 PC with no hard-drive, 512 MB RAM, Knoppix cd on the cd-rom. If something went wrong. I simply press the reset button and reboot knoppix from cd. That's the beauty of Linux Live CD, isn't it?

The following steps were tested using Knoppix 4.0.2, 5.0.1 and 5.1.1

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling 2nd Jan 2008

1. Setup knoppix password

 $ sudo passwd knoppix

It will ask you to input the password twice.

Knoppix booted with no password setup on the knoppix id. But you need one for ftp login, don't you?

2. Modify file /etc/hosts.deny

Edit the file /etc/hosts.deny, comment the line "ALL: PARANOID" and then save the file.

 $ sudo vi /etc/hosts.deny

3. Modify file /etc/hosts.allow

Edit the file /etc/hosts.allow, change the line "ALL : ALL@ALL : DENY" to the following line and then save the file.

 $ sudo vi /etc/hosts.allow
 ALL : 192.168.1.* LOCAL : ALLOW

Here I open up the server to all machines inside the subnet 192.168.1.*

4. Restart the inetd daemon

For knoppix 5.1.1:

 $ sudo /etc/init.d/openbsd-inetd restart

For knoppix 5.0.1 or older:

 $ sudo /etc/init.d/inetd restart

Now the FTP server is ready for logon, go to one of the other machine in the subnet and you should be able to connect to the server via FTP.

Q: How to setup Samba on Knoppix and share it's drive to other Windows XP machines ?

A: It maybe my problem, however, I can hardly find the information I want from the Samba site so I decided to write some simple steps here and hopefully can help someone.


I have two Windows XP machines on my network, I want to boot knoppix live CD 5.1.1 on the first machine. Make two locations on the first machine as shareable. Then I try to map these two locations as network drives on the second Windows XP machine.

The following two locations will be made shareable:

 1. The whole C drive
 2. D: drive directory \mp3

I do not want everybody can access my c: drive, so I will limit it to those with the samba account. However, I will open the d:\mp3 location to everybody.

The following steps were tested using Knoppix 5.1.1

The information here may not be 100% correct, but it works for me. However, if you find something is wrong. Please let me know. Thank you.

Chip Ling 5th Sep 2008

1. Boot up the first machine to Knoppix

Boot the first machine with Knoppix Live CD 5.1.1. Check for it's IP address by open up the console terminal (the black TV screen like icon on the bottom of the screen) and type in the following command:

 $ ifconfig

To make it easier to follow, I assume the IP address of the Knoppix machine is

2. Boot the second machine to Windows XP

Boot the second machine to Windows XP and write down it's IP address. To obtain the machine's IP address. Open up the command prompt (DOS box) and enter the following command:

 C:\> ipconfig

I assume the IP address of the Windows XP machine is

3. Make sure the two machines talk to each other

From the Knoppix machine, try to ping the Windows XP machine, on the console terminal, enter the following command:

 $ ping

You should get lines response back saying it got reply from, hit Control+C to exit.

From the Windows XP machine, from the DOS box, try to ping the Knoppix machine:

 C:\> ping

You should get 4 lines response and it will stop by itself.

Now you are sure these two machines can talk to each other.

4. Mount the c: drive and d: drive to the Linux file system on the first machine

Since I boot up the Knoppix from Live CD so both drive c: and drive d: are not mounted by default. In order to share them to other machines on the network, I have to mount it first.

I have a SATA hard drive divided into two partitions (c: drive and d: drive). So my device name in Linux will be sda1 and sda2.

I have other machines with the old IDE hard drive with the same partition setting which will show in Linux as hda1 and hda2. So according to your own setting, use the correct device name. Here I will use sda1 and sda2 as an example.

Both the c: drive and d: drive are formatted to NTFS format.

From the knoppix machine, the console terminal, enter the following commands:

 $ su
 # mount -t ntfs /dev/sda1 /media/sda1
 # mount -t ntfs /dev/sda2 /media/sda2

OK, now I have both c: drive and d: drive mounted as read-only on mount points /media/sda1 and /media/sda2

Note: If your drive is formatted as FAT32, change the "-t ntfs" to "-t vfat" on the above mount commands.

5. Create a Samba user called "knoppix" with password

Enter the following commands from the console terminal of the knoppix machine:

 # smbpasswd -x knoppix
 # smbpasswd -a knoppix

To stay on the safe side, I remove the user "knoppix" first and then add him back in. It will ask you twice for a password, in this example, I use the password "12345678".

6. Edit the /etc/samba/smb.conf

Use the editor of your choice to edit the /etc/samba/smb.conf file. I only know vi so I do the following from the console terminal on the knoppix machine:

 # vi /etc/samba/smb.conf

Append the following lines to the file and save it.

 browseable = no
 read only = yes
 browseable = yes
 read only = yes

Some explanations here:

"[drivec] and [mp3]" will be the share drive names that Windows will see and use later on.

"path=/media/sda1" means the c: drive, the root directory (i.e. the whole c: drive).

"path=/media/sda2/mp3" means the d:\mp3 folder.

"browseable = no" means not all users can connect to this location. Only those with a Samba user account can access this location.

"browseable = yes" means all users can connect to this location.

"read only = yes" means read-only.

7. Restart the Samba to make the new change effective

From the console terminal on the knoppix machine, enter the follow commands:

 # /etc/init.d/samba restart

8. Map the share drive [drivec]

From the Windows XP machine

==> open the window explorer

==> click on Tools

==> click on Map Network Drive

==> Pick a drive id: ==> I select Z: here

==> On the Folder field, enter:


==> click Finish

Another dialog box pops up asking for user-name and password: enter user=knoppix and password=12345678 and then click OK.

Another window explorer window pops up and connects to the remote knoppix box drive c:\ as the network drive Z:.

9. Map the share drive [mp3]

From the Windows XP machine

==> open the window explorer

==> click on Tools

==> click on Map Network Drive

==> Pick a drive id: ==> I select Y: here

==> On the Folder field, enter:


==> click Finish

This time it will not ask for user id and password.

Another window explorer window pops up with and connects to the remote knoppix box drive d:\mp3 as the network drive Y:.

Voila. So we are done now.

From the Windows XP machine, we can access the two locations on the knoppix machine via the network drive id Z: and Y:.

Welcome to the Samba world in Knoppix and have fun.

By changing the read only parameter from yes to no and modify the step 4 mount to read/write will open the location for write access but I suggest to use it with really really great care. You don't really want someone to delete all your c: drive content by mistake, right? Don't say I did not warn you...

Q: How to automate Samba setup on Knoppix 5.1.1?

A: There maybe a lot of solutions but here I wrote a bash shell script to achieve the goal.

Chip Ling 23 Sept 2008


To avoid typing all the steps every time we reboot the knoppix machine. By creating a script on c:\ or /media/sda1, we only need to run the script once after each reboot.

Network set up

This FAQ is based on the setting of the previous FAQ question. So please revisit the previous FAQ to get a complete picture.

1. Boot up the Knoppix machine

Insert the Knoppix 5.1.1 Live CD and boot the system up on the first machine.

2. Mount the c: drive as read/write

Click on the konsole icon (the black TV screen at the bottom) and then enter the follow command.

 $ sudo mount -t ntfs /dev/sda1 /media/sda1 -o rw

Again if your PC is using IDE harddisk, then replace all the sda1 by hda1. If your hard disk is formatted as FAT32 instead of NTFS, replace "-t ntfs" by "-t vfat".

3. Create the on /media/sda1

Use the editor of your choice to create the on /media/sda1. (i.e. it is on the c:\, so if you create the file under windows, it SHOULD work as well. Let me know if it is not, I never try it myself from the windows side.)

 ### by Chip Ling
 if [ ! -e /media/sda1/ ]; then
   sudo mount -t ntfs /dev/sda1 /media/sda1
 sudo mount -t ntfs /dev/sda2 /media/sda2
 sudo smbpasswd -x knoppix > /dev/null
 sudo smbpasswd -a -s knoppix <<EOF
 sudo chmod 666 /etc/samba/smb.conf
 cat >> /etc/samba/smb.conf <<EOF
 browseable = no
 read only = yes
 browseable = yes
 read only = yes
 sudo chmod 644 /etc/samba/smb.conf
 sudo /etc/init.d/samba restart
 ipaddr="\\\\$(ifconfig eth0 | head -2 | tail -1 | cut -f2 -d':' | cut -f1 -d' ')"
 msg1="\nPlease map to ${ipaddr}\\drivec"
 msg2="\nand           ${ipaddr}\\mp3"
 dialog --title "Samba restarted" --msgbox "${msg1}${msg2}" 7 60

Save the file.

The script basically replicates what we manually did on the previous FAQ. Please be careful about the spacing on the "if ... then" statement. Cut and paste is not a bad idea.

Then from the konsole, change the file attribute to executable

 $ sudo chmod 777 /media/sda1/

And we are done.

Please note that I do not need to perform the above step on my machine. I check the file attribute and it is set to 777. I put the command here just in case.

Now, we can reboot the knoppix machine again and see how it works.

4. The real thing

First reboot the knoppix from the Live CD.

Then mount the c: drive to the file system.

For GUI user: single click the "Hard Disk [sda1]" icon on the desktop. The icon will then have a green tag appears at the lower right hand corner (means mounted) and Konqueror pops up.

For command line user: from the konsole, enter

 $ sudo mount -t ntfs /dev/sda1 /media/sda1

Now run the auto-samba setup script:

For GUI user: single click on the file icon inside Konqueror.

For command line user: run the script in konsole

 $ /media/sda1/

The script should setup the samba configuration and then display the share drive mapping information from a dialog box.

 Please map to \\\drivec
 and           \\\mp3

Now the samba setting on the knoppix side is done, move forward to the windows box to map the share drives.