Archive for the ‘Operating Systems’ Category

Virtualbox Virtual Bridging

Saturday, November 22nd, 2008

I’ve been using VMWare for the last couple of years. What I really liked about it was that when you ran the vmware-config.pl script, it would automatically set up interfaces for the virtual machine to interact with the host OS. What I didn’t like was that the guest OS was so slow. I heard about Parallels, and from what I’ve seen, it’s a very slick and had a great feature that allowed you to switch to seamless mode. In this mode, you could run applications with the illusion that you were running the application within the guest OS, in my case Linux.

Since I was running Linux, Parallels was not an option for me. Instead I dug in and found a Virtualbox. This VM also had the seamless mode feature which I’ve grown to really love and has become a key feature that I look for. Another great advantage of the VM is that it’s fast, really fast! It seems so fast, that it’s almost like running Windows XP (for example) right on my hardware. Plus, booting Windows XP is so much faster than if I were to install it and load it right from disk.

Enough about Virtualboxes feature. What I’m really doing is describing how to get the guest OS to access the host OS file system through samba.  By default, Virtualbox uses the IP of the host OS to get online. This is fine and dandy, but what if you wanted to access shares on the host from within the guest OS? This is how you do it:

  1.  Make sure that the kernel has 802.1d Ethernet bridging and that Universal TUN/TAP device driver support is either compiled into the kernel or as a module.
  2. Login as root
  3. create the device. The output will tell you that the device has been created and the ID of the person who owns it:
    # tunctl -t tap0 -u username
    Set tap0 persistent and owned by uid 500
  4. Change the permissions of /dev/tun to 666 (tun may be in /dev/net)
    # chmod 0666 /dev/tun
  5. Create the bridge
    # brctl addbr br0
  6. Add the real interface to the bridge
    # brctl addif br0 eth0
  7. Add the tunnel interfaces to the bridge
    # brctl addif br0 tap0
  8. Bring up the bridge
    # dhcpcd br0

The last part is modifying some of the guest OS’ settings. Start VirtualBox, select an OS, click on Network, make sure that the network adapter (or at least one of them) is enabled.  Change Attached to so it says Host Interface then type in tap0. Finally click OK and start the virtual machine.

If you need to add more than one interface for running multiple Virtual Machines at once,

Auto Connect in Win2k and XP

Saturday, July 26th, 2008

While working at my last job I’ve come across this a lot. Windows simply stops connecting to the internet when you try to open IE (Internet Explorer) or Fire Fox. This really isn’t an issue anymore since most people have broadband internet.

Under the Control Panel:

  • Double Click ‘Administrative Tools
  • Double Click ‘Services
  • Double Click ‘Remote Access Auto Connection Manager
  • In the Startup type: pull down menu, select ‘Automatic
  • Click the Start button.

The next step is to make sure that you have a connection already configured and that it’s set to autodial:

  • Start->Settings->Network and Dial-up Connections
  • Ensure that there is a dialer or create one if there isn’t
  • Select the Dialer
  • Click the ‘Advanced‘ pull down menu
  • Select ‘Dial-up Preferences…
  • Under the Autodial Tab, enable the ‘Enable autodial by location‘ checkbox

Optionall, if you sometimes connect to a network and use dialup:

  • Start->Settings->Network and Dial-Up Connections
  • Click the ‘Advanced‘ pull down menu
  • Select ‘Advanced Settings…
  • Under the Adapters and Bindings tab, in the Connections: window, choose the order for DNS to use (LAN or dialup adapter)

Perl and Apache on Mac OS X

Tuesday, July 22nd, 2008

The other day while I was modifying a client’s site I saw that his contact form was in PERL. Recently I just got a Mac Book Pro. I’ve set up XAMPP and Eclipse on it to do my PHP programming, but I didn’t count on getting into any PERL. As a challenge I thought it would be fun to do some PERL programming.

I first installed XAMPP. Right out of the box I was able to do PHP programming and access MySQL databases which saved me some time configuring and trouble shooting issues. Or so I thought. I’ve written PERL scripts before, but never done anything that would run on a web server. When it comes to writing pages in PHP, just write the code and it works. That’s because the headers are sent for you. As a test I put the following into my script:

#!/usr/bin/perl

print(”Hello!”);

Expecting it to work. However I would get an error message saying Error 500. I looked at the log file /Applications/xampp and saw that the script was ‘exiting prematurely’ which did not make any sense at all. I could run the PERL script just fine on the command line.

After doing some digging around, about an hours worth I finally found what I was looking for. I needed to print the headers. In order to get my PERL script to work with Apache I needed to add the following:

use strict;
use CGI;

my $cgi = new CGI;

so now the script looks like:

#!/usr/bin/perl

use strict;
use CGI;

my $cgi = new CGI;

print $cgi->header . $cgi->start_html . “hi” . $cgi->end_html;

The key to this script is the $cgi->header function call. With out it, you will get an internal server error. There are other functions associate with the CGI class. The start_html and end_html are the beginning and closing HTML tags.

Disabling iSight Built in Mac Web Cam

Saturday, June 28th, 2008

I’ve never been a fan of Web Cams, but my Mac Book Pro did not come with the option of not having one. Since I’m a bit on the paranoid I want a way to disable the camera.

The easist way, but not the best way is to move or rename a file. The file that we’re looking for is the QuickTimeUSBVDCDIgitizer.component file. This file is located in the /System/Library/QuickTime folder.

What I did to disable my iSight was move the file up a directory. When any application tries to access the camera, it will say it’s in use.

Right now I’m not aware of any other way to disable the camera, but I will continue to look into it. I’m also looking into disabling the internal microphone.

Java Doc

Thursday, April 3rd, 2008

Documentation is key when programming. There is the documentation in the code itself such as what the heck you’re trying to do there. There is also the documentation that describes the functions and objects and how to use them. Luckily there is a tool that helps the programmer create nice HTML documentation based on the comments within the code. This knocks out two birds with one stone. Javadoc is the tool to use for this task. There is also PHPdoc as well for, you guessed it PHP.

For this entry we’ll only be concerned about Javadoc.

(more…)

Recovering iTunes Music

Thursday, January 31st, 2008

Occasionally I will get a customer in my store whose library has been corrupt or lost but their music is still on their iPod. The way that apple designed iTunes is that if the library gets messed up, you run a high risk of losing your music. Fortunately there is a way around that. What I do to save the customer’s music is take their iPod, connect it to my Linux computer. In order to see the files on the iPod, you’re going to need a few drivers either compiled as modules or into the kernel:

  • Device Drivers
    • USB Support
      • <*> Support for Host-side USB
      • [*] USB device filesystem
      • <*> EHCI HCD (USB 2.0) support
      • <*> OHCI HCD support
      • <*> UHCI HCD (most Intel and VIA) support
      • <*> USB Mass Storage support
      • [*] USB Mass Storage verbose debug
      • [*] Datafab Compact Flash Reader support (EXPERIMENTAL)
      • [*] Freecom USB/ATAPI Bridge support
      • [*] ISD-200 USB/ATA Bridge support
      • [*] Microtech/ZiO! CompactFlash/SmartMedia support
      • [*] USBAT/USBAT02-based storage support (EXPERIMENTAL)
      • [*] SanDisk SDDR-09 (and other SmartMedia) support (EXPERIMENTAL)
      • [*] SanDisk SDDR-55 SmartMedia support (EXPERIMENTAL)
      • [*] Lexar Jumpshot Compact Flash Reader (EXPERIMENTAL)
  • File systems
    • DOS/FAT/NT Filesystems
      • <*> MSDOS fs support
      • <*> VFAT (Windows-95) fs support
    • Miscellaneous filesystems
      • <*> Apple Macintosh file system support (EXPERIMENTAL)
      • <*> Apple Extended HFS file system support.

I compiled in all the things under USB support for various other things. If you don’t need them then you don’t have to compile them into the kernel.

Once you recompile the kernel or compile the modules and load them, you can connect the iPod to the computer and then mount it. When you try mounting it, it’s going to be a SCSI device. After you have mounted the iPod, Copy all the m4a files from the ipod_control folder, then re-import them into iTunes.

Enabling Auto Login in Windows XP and Vista

Saturday, December 22nd, 2007

Some people don’t like to enter a user name or password to use their computer. For others it’s pointless as they are the only one using the computer. To disable the Login Prompt follow the steps below.

  1. Start->Run

  2. Un-check the box that says “Users must enter a user name and password to use this computer”

That’s it. You no longer have to enter a user name or password to use the computer.

Corrupted User Profile

Tuesday, October 16th, 2007

If you ever log into your Windows XP account and you see this error:Windows cannot load your profile because it may be corrupted. You may be logged in using a temporary User Profile.

The way that Microsoft says to repair this problem is to backup the user’s data and recreate the account.

(more…)

Rearming Windows Vista

Saturday, May 5th, 2007

Introduction

At work we have a Core 2 demo running Windows Vista. This demo is not connected to the network because we don’t want people coming in and changing the background image to display something obscene or pornographic. There is a neat little trick that I found one day while trying to figure out how I could reset the time until the user had to activate Windows Vista.

(more…)

SVCHOST Error on Logon

Saturday, February 24th, 2007

If you log on to the computer and you see a message like this:

svchost.exe — application error the instruction at “0×745f2780″ reference memory at “0×00000000″. the memory could not be ‘read’

Chances are that you have corrupted Windows Update data. To fix this problem follow these steps: (more…)