Run Debian on USB Stick

The colinux could run without any install, just need to extract. So, I build a script for got install files, and run it. I download the Colinux image files and shrink it to about 256 M bytes. With my batch script deb.cmd, I can run it without install.


deb 64 -- run with 64 M memory debian


Just download the new colinux archive and extract to this directory

Download my scripts[]

My Colinux Web Page here is the main script deb.cmd

@echo off
if not "%2" == "" goto _usage
if "%1" == "" goto _usage
if "%1" == "1" goto _1
if "%1" == "2" goto _2
if "%1" == "3" goto _3
set MEM=%1
goto _try_remove
  echo Usage: deb [1/2/3/mem_size]
  echo  deb 1 -- get web files (wget required) and do "deb 2"
  echo  deb 2 -- extract them (7zip required) and do "deb 3"
  echo  deb 3 -- create swap file system and do "deb 64"
  echo  deb 32 -- run debian with 32 Mega RAM
  goto :eof
  echo --- will get files from web
  echo on
  wget -c
  wget -c
  wget -c
  echo --- all files got
  c:\Progra~1\7-Zip\7z.exe x Debian-4.0r0-etch.ext3.1gb.bz2
  ren Debian-4.0r0-etch.ext3.1gb deb.fs
  c:\Progra~1\7-Zip\7z.exe x devel-coLinux-20071105.exe
  c:\Progra~1\7-Zip\7z.exe x -otopo
  @echo off
  echo --- debian file system deb.fs extracted
  echo --- you can shrink the deb.fs by run topo\toporesize.bat
  echo --- will create swap file system
  echo on
  cd topo
  tfile.exe ..\deb.swap 64
  cd ..
  @echo off
  start deb_README.txt
  set mem=64
  echo on
  colinux-daemon.exe --remove-driver
  colinux-daemon.exe --install-driver
  @if not errorlevel 1 goto _run
  @echo Err: install failed
  @goto :EOF
  rem running with slirp driver, mount cdrom as hdc, mount c:\ as cofs1:/, redirect tcp port 22,5000 to
  rem \Device\HarddiskX\PartitionY   X:start from 0,  Y:Start from 1
  rem hda3=\Device\Harddisk0\Partition5 hda4=\Device\Harddisk0\Partition6 hda5=\Device\Harddisk0\Partition7 
  colinux-daemon -t nt kernel=vmlinux mem=%MEM% initrd=initrd.gz hda1=deb.fs hda2=deb.swap cofs1=c:\ root=/dev/hda1 eth0=slirp,,tcp:22:22/tcp:5000:5000
  rem for all colinux installed on USB stick, remove the driver after run
  colinux-daemon.exe --remove-driver
  set mem=


After logon by root(password:root) later, do these jobs

  • change your root password
  • disable other to access your colinux box
nano /etc/hosts.allow # edit the file, append following line
  • create normal user account, eg. daniel
useradd -g users -m daniel
passwd daniel
  • enable swap space
mkswap /dev/cobd1
swapon -a
  • search the package you want to install, eg. vim
apt-cache search vim
  • get packages you want eg.
apt-get install openssh-server mercurial patch python-setuptools
  • access the C:\ by /mnt/win directory
mkdir -p /mnt/win
mount -t cofs cofs1:/ /mnt/win
  • adjust the deb.cmd
The default deb.cmd will launch a colinux box with following options:
    • cofs1=c:\ -- mapping the c:\ to cofs1:/ cofs device
    • eth0=slirp,,tcp:22:22/tcp:5000:5000
mapping port 22 for ssh access and sample 5000 port
you can access colinux by putty through localhost:22

You can adjust the deb.cmd to your personal environment option.


The batch file deb.cmd and this README is written by Daniel YC Lin. < <AT>> If you found any bug or suggestion, welcome to contact him.