Archive for the ‘Hardware’ Category

a headless Debian Lenny VirtualBox install

After extreme disappointment with VMware Server 2, I thought I might try setting up a headless VirtualBox install with a hopefully faster web interface. I need to be able to run Windows Server 2008 instances on occasion to troubleshoot and test my scripts on IIS7. I also am looking for a more regularly updated virtualization software to take over my aging VMware server 1.10 installs.

Much of the following is based off of “VBoxHeadless – Running Virtual Machines With VirtualBox 3.1.x On A Headless Debian Lenny Server“, “instructions [Debian Backports]“,  and the VirtualBox.org website’s information about Debian VBox setups. FYI: this install was done on a fresh Lenny netinstall (logged in as root … duh!), and the apt-get install command grabed about 200MB worth of compressed packages that unarchive into about 500MB worth of disk space used.

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -
wget -q http://backports.org/debian/archive.key -O- | apt-key add -
echo -e "\ndeb http://download.virtualbox.org/virtualbox/debian lenny non-free\ndeb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install virtualbox-3.2 dkms
groupadd vboxers
useradd -d /home/vboxers -m -g vboxers -s /bin/bash vboxers
passwd vboxers
adduser vboxers vboxusers
apt-get install libapache2-mod-php5
a2dissite default
mkdir -p /srv/vbox
chmod -R 777 /srv
echo -e "<VirtualHost *:80>\nDocumentRoot /srv/vbox\n</VirtualHost>" > /etc/apache2/sites-enabled/vbox
/etc/init.d/apache2 restart
apt-get install screen

Open up the local start up file “vi /etc/rc.local” and insert “su vboxers -c "screen -dmS vboxwebsrv vboxwebsrv"” before the “exit 0″. Download the phpvirtualbox code [http://phpvirtualbox.googlecode.com/files/phpvirtualbox-0.5.zip], unzip and modify the config.php file to match the vboxers user we set up earlier. Finally upload the contents of the archive to the vbox directory over SFTP or something. Reboot the machine (for good measure), and you should be able to go to http://host/ to access the web interface. Beware this a completely unprotected setup!

recover sd card data with linux and gddrescue

Just to be clear about the setup, I’ll be using Debian 5 Linux and an 8 GB SD card with a SD to USB adapter over a USB 2.0 link.

gddrescue is included in the main Debian and Ubuntu repos, so in my case the install was just an “apt-get install gddrescue“.

Plug in your sd card and watch dmesg for the sd card. Mine was added to /dev/sda as one can see from the following output:

[ 2540.580007] usb 5-4: new high speed USB device using ehci_hcd and address 2
[ 2540.776619] usb 5-4: configuration #1 chosen from 1 choice
[ 2540.781484] scsi1 : SCSI emulation for USB Mass Storage devices
[ 2540.781939] usb 5-4: New USB device found, idVendor=090c, idProduct=6000
[ 2540.781947] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2540.781953] usb 5-4: Product: USB2.0 Card Reader
[ 2540.781957] usb 5-4: Manufacturer: Generic , .
[ 2540.781961] usb 5-4: SerialNumber: 12345678901234567890
[ 2540.781977] usb-storage: device found at 2
[ 2540.781980] usb-storage: waiting for device to settle before scanning
[ 2545.780245] usb-storage: device scan complete
[ 2545.781307] scsi 1:0:0:0: Direct-Access Generic 6000 PQ: 0 ANSI: 0 CCS
[ 2545.783697] sd 1:0:0:0: [sda] 15855616 512-byte hardware sectors (8118 MB)
[ 2545.784973] sd 1:0:0:0: [sda] Write Protect is off
[ 2545.784983] sd 1:0:0:0: [sda] Mode Sense: 4b 00 00 08
[ 2545.784988] sd 1:0:0:0: [sda] Assuming drive cache: write through
[ 2545.787318] sd 1:0:0:0: [sda] 15855616 512-byte hardware sectors (8118 MB)
[ 2545.787949] sd 1:0:0:0: [sda] Write Protect is off
[ 2545.787958] sd 1:0:0:0: [sda] Mode Sense: 4b 00 00 08
[ 2545.787963] sd 1:0:0:0: [sda] Assuming drive cache: write through
[ 2545.788050] sda: unknown partition table
[ 2545.795255] sd 1:0:0:0: [sda] Attached SCSI removable disk

While logged in as root (or using sudo) make a copy of the sd card: ddrescue [/dev/device] [recovery image output] [logfile]

Now we will also need testdisk, so install that [Debian] [Ubuntu]: apt-get install testdisk

Testdisk can do some pretty cool stuff, but we are more interested in one of the subpackages it includes, photorec.

Now using photorec, let’s recover some photos: photorec /d [photo output dir] [recovery image output file from before]
And navigate through the menus and get your photos back. Usually the sd card is formatted in NTFS.

DWL-G510 rev B running native in Linux

After some searching around on the Google machine, I came across “Linux wireless LAN support“. It’s one of the most complete directories I’ve seen for a very long time. I had a suspicion that my DWL-G510 pci card might work, as it is old enough and I’ve read about other similar models of D-Link card being supported natively. It turns out that mine works seamlessly with stuff from the MadWifi project. Because I was feeling lazy and wanted a tried and true install method, I found “How To Install MadWifi On Debian 4.0 (Etch)” by Sumardi Shukor. The following is based on the article on his blog.

vi /etc/apt/source.list [add "contrib non-free" after "main" to the various lines]
apt-get update
apt-get install build-essential module-assistant wireless-tools
module-assistant
module-assistant auto-install madwifi-source
modprobe ath_pci
ifconfig ath0 up [bring up the wireless interface]
iwlist ath0 scanning [scan for a wireless network to connect to]

I suggest using a GUI app to do the rest, such as wicd.

Return top