Wednesday, October 20, 2010

Vaio X and Ubuntu 10.10 Maverick

Here is how I make my Sony Vaio X work with Ubuntu 10.10.
I recently upgraded from 10.04 (here is my guide for installing 10.04) and found 10.10 much better (includes WWAN loader).
The installation/upgrade is not seamless and still need some tweaks.
Working:
  • LAN + WLAN
  • Trackpad with scroll area (no multi touch)
  • Audio/built in speakers
  • 2D graphics with external display (3D and Hardware Video Acceleration is also claimed to work) *
  • USB/Bluetooth *
  • WWAN 3G modem (Qualcomm Gobi 2000) *
  • Built in web camera (Tested ok with Skype, PIP does not work / worked in 10.04)
Not working:
  • Stand by / hibernation (kernel regression? - display comes back too bright or white)

Here are my steps:

1. Install Ubuntu from USB (instructions here).
Keep Windows 7 (WWAN drivers are located there).

* 2. Install Poulsbo video driver for GMA 500 (information here):
sudo add-apt-repository ppa:gma500/ppa && sudo apt-get update && sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config && sudo reboot

* 3. Bug fix for USB/Bluetooth:
sudo nano /etc/default/grub
# append " memmap=1K#0x7f800000" to GRUB_CMDLINE_LINUX_DEFAULT)
# My working example: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem=1900mb nohz=off acpi_osi=Linux memmap=1K#0x7f800000"
sudo update-grub

* 4. Install WWAN 3G modem support:
sudo mkdir /lib/firmware/gobi
sudo cp "/media/70E256E3E256ACDA/Program Files/QUALCOMM/Images/Sony/UMTS/"* /lib/firmware/gobi
sudo cp "/media/70E256E3E256ACDA/Program Files/QUALCOMM/Images/Sony/6/UQCN.mbn" /lib/firmware/gobi
sudo apt-get install gobi-loader
# and then Enable Mobile Broadband in the network tray application.

The above leaves the Vaio X fully working. I have always been a fan of hibernation but with web browsers being able to remember windows/tabs between restarts I'm still surviving without so far.

Tuesday, October 12, 2010

Bind a non-root service to port 25 on Ubuntu with Authbind

Ports 1-1024 including 21 (ftp), 22 (ssh), 25 (smtp), 80 (http), 110 (pop3) can only be bound by services running as root.

Error messages indicating you have this problem are "Permission denied", "IOError when attempting to open socket ( constructor ), shutting down! java.net.BindException: Operation not permitted" or "java.net.SocketException: No such file or directory".

I recently developed my own smtp listener (converting e-mail to text/sms messages) and rather run the service as it's own user. Here's how (for port 25):

Install authbind (allows a program which does not or should not run as root to bind to low-numbered ports in a controlled way):
apt-get install authbind

Configure authbind (replace user with your user):
touch /etc/authbind/byport/25
chown user:user /etc/authbind/byport/25
chmod 755 /etc/authbind/byport/25

Start the service (simple test):
authbind nc -l -p 25 -e "/usr/bin/uptime"

Start the service (java):
authbind --deep /bin/bash -c "/usr/bin/java -Djava.net.preferIPv4Stack=true com.cent.texter.TexterServer"