Monday, October 6, 2008

Piped Serial Port on VirtualBox

There is another very cool feature on Linux and VirtualBox which might solve compatibilities of old softwares that require serial connections. It's the host pipe serial-port. On VirtualBox, enable Serial port and select "Host Pipe", check "Create Pipe" and in "port path" textbox, type /tmp/com1_sock.

When my Windows XP is runnning, it recognizes the COM1 and is able to communicate. The byte-streams are actually piped to /tmp/com1_sock (if we don't do anything, it just acts as a dummy). If we want to forward it as a listening port (e.g, as a tcp server so remote systems are able to communicate with the COM1 via TCP/IP), on Linux host's shell type: socat UNIX-CONNECT:/tmp/com1_socket TCP-LISTEN:. We can pick any available tcp port, for example 8040.

Here's the example:

socat UNIX-CONNECT:/tmp/com1_socket TCP-LISTEN:8040

From another terminal (either local machine or remote machine) we can telnet to this port. For example, from our own Linux host, we can communicate to the Hyperterminal running under Windows-XP guest via this virtual serial port by telnetting to the port:

telnet localhost:8040

Voila! Our Linux machine will display anything we type on Hyperminal. This opens up a lot of experiments for us.

Sunday, October 5, 2008

Using Host-Interfacing and Bridging on VirtualBox

NAT interface on guest OS gives limitation so we may need to add a new virtual interface to it. This is called 'HIF' (Host Interface).

Steps:
  1. Install bridge-utils, if not yet installed:
    sudo yast -i bridge-utils

  2. edit /etc/sysconfig/network/ifcfg-br0 and write:


  3. BOOTPROTO='dhcp'
    NETMASK='255.255.255.0'
    STARTMODE='auto'
    USERCONTROL='no'
    DHCLIENT_TIMEOUT=30
    BRIDGE_PORTS='eth0'

  4. Edit /etc/sysconfig/network/ifcfg-eth0 and change the content to:
    BOOTPROTO='static'
    IPADDR='0.0.0.0'


  5. Create a new permanent interface:
    VBoxAddIF tap0  br0

  6. Configure the guest to have the second Virtual Network Interace and assign 'tap0' as its name

Friday, October 3, 2008

My BlackJack is dead!

Today my 3-months-old Samsung Blackjack II has died for no reason. I've charged the battery for hours but still no luck to turn it on. No sign of life on the cute gadget. Darn, seems I have to bring it to closest store for fix.

Using Xwindow client-server

Before starting, make sure both client and server (remote machine) have port 6000 open for Xserver (on SuSE, file /etc/sysconfig/displaymanager should contain DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="yes"). Once you have changed it, restart Xwindow (or refresh it by pressing CTL-SHFT-BKSPACE).

  1. From local shell, type "xhost +". This will allow this client to connect to all hosts
  2. ssh to remote machine as: "ssh -Y -o ForwardX11Trusted=yes ". If after following steps it does not work, try "ssh -X -o ForwardX11=yes " (although this is less secure)
  3. Once we're in remote machine, type "xhost +" as well.
  4. if we just want to redirect a single X application, we can pass -display directly to the application. For example, to bring remote xterm window to our local screen, just type "xterm -display address:0", e.g.: xterm -display 192.168.1.4:0
  5. If we want to redirect all new X applications to our local screen, modify environment variable DISPLAY. For example: export DISPLAY=192.168.1.4:0 and then type any GUI applications.

Thursday, October 2, 2008

Google IMAP Settings

Incoming Mail (IMAP) Server - requires SSL: imap.gmail.com
Use SSL: Yes
Port: 993
Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587
Account Name: your full email address (including @gmail.com) Google Apps users, please enter username@your_domain.com
Email Address: your full Gmail email address (username@gmail.com) Google Apps users, please enter username@your_domain.com
Password: your Gmail password

Sunday, August 17, 2008

Mount NTFS disk to Mac OS X

All portable/external had disks currently support legacy FAT (or VFAT as Linux so calls it) from DOS era. The file system is ugly in a sense that it is a 'greedy FS which consumes more space than many other file systems. We can easily use up all the space in our harddisk just by putting many video files into this FAT-formatted harddisk.

Started in NT, a new format was introduced: NTFS (Next-Technology File System). It is quite decent FS, except it seems doesn't fully support journaling (I heard it does, but not sure about that since it is a proprietary format from Microsoft).

Anyway, I don't want to talk too long about the FS, but I just want to talk more about how could the harddisk possibly be mounted to a OS-X based Mac machines? The answer is: use MacFUSE and NTFS-3g!
These opensources were originally targetting the development for Linux, but some folks have ported them to OS-X.

To install, first you need to install MacFUSE (search google to find the location), and after it is successfuly installed, install the OSX version of NTFS-3g. It may require you to reboot. After reboot, try to connect an NTFS-formatted external hard disk to Mac's available USB port. If the system can recognize and mount it, you're done.

I have a 2.5" "WD Passport" 250 GB external hard disk which was I reformatted in NTFS after I bought it. In the beginning, out of curiousity I attached it to my Linux machine running OpenSUSE 10.3. Out of my suprise, It could recognized and mounted it with no issues. I then found out that on my Linux has NTFS-3g in it installed by default. After googling, I found the ported Mac version. Now, all my machines (OSX, Linux, XP) are able to read/write files into this small-but-nice device.