|
|
 |
Installing Ubuntu Linux on a MacBook
Now when we have the hardware in place lets go through the process of installing the software we need. The first thing we have to install is the virtualization software that enables us to run multiple operating systems on top of Mac OS X. There are several offers but I have choosen Parallels Desktop from Parallels Inc.
- Order the program and download it from Parallels download page.
- Installing Parallels is no different than installing any other OS X program that uses an installer. Double-click the installer, follow the prompts, and wait for it to finish. After installation, you'll find the program in the Parallels folder in the Applications folder. Behind the scenes, Parallels has installed quite a few things on your machine, including a kernel extension (a low-level tool that modifies the core of OS X) to enable its magic.
- The next step is selecting the Linux distribution we would like to use. All CAD vendors tell us they only support RedHat Enterprise Rel 3 or 4 but that doesn't stop us from using our favorite Linux distribution. I will use Ubuntu 6.10. Ubuntu is a complete Linux-based operating system, freely available with both community and professional support. It is developed by a large community of developers and its small size (it fits on one CD) makes it perfect for our usage.
- Download the CD image (ubuntu-6.10-desktop-i386.iso) from the Ubuntu download page.
- The file is 700MB so try to find a high-speed connection.
- Start Parallels Desktop and click the "New VM" button. Click the Next button in the window displayed. The next window will look like this. Select "Create a typical VM" and click the next button.

- Select the guest OS to be used. Set guest OS type to Linux and guest OS version to Debian Linux and click the next button.

- The Configuration Editor window will be displayed. In this window you can change the configuration of the virtual machine. Select the CD/DVD-ROM setup to specify the image file to be read during installation. Select "Use image file" and enter the full image file name .../ubuntu-6.10-desktop-i386.iso. You may also want to change the size of the memory from 256 MB to 512 MB if you have at least 1 GB installed in your Mac. If you need more than 8 GB hard disk you should also change the "Hard Disk" setup. When finished click "OK".

- Start the virtual machine by clicking the green triangle. The installation will now start and in a few minutes the Ubuntu installation startup window will be displayed. Double-click the install icon to continue the installation. Then there a is six step process to define the default language, the time zone, the keyboard layout, username and password and to prepare the disk (erase all). From when you click the install button the whole installation will take less than 15 minutes.

- After the installation has finished you must restart the virtual machine. Before restarting, edit the setup and change CD/DVD-ROM back to default. The Ubuntu Linux will start and you are ready to login.
- For adding Parallels Tools see this tutorial.

If this didn't help here is an even better installation guide.More information Top Next
Posted at 03:16 pm by svenand
Permalink
Customizing Ubuntu Linux 1
After installing Ubuntu Linux on my MacBook I need to add more software and to fix a number of setups to make everything run smoothly. In this chapter I will describe the process to make this Linux installation perfect for my needs. I had much help from reading the book Ubuntu Hacks by Jonathan Oxer, Kyle Rankin and Bill Childers. Here is a link to the Unofficial Ubuntu 7.04 Starter Guide.
Look for help
There are many places where you can look for help when you have a problem with Ubuntu Linux. Here are some places: Software packages
One of Ubuntu's key strengths is the quality of the software packages that are included in the main distribution. They have been relentlessly tested, and come together to form a rock-solid Linux distribution. Although the main Ubuntu distribution is integrated and very solid, that stability comes at a price. Many of the optional packages you may want have been excluded from the main distribution. There are several ways to download and install packages. The most common way is to use the command <apt-get>. The use of <apt-get> and other ways of managing packages are well described in the book Ubuntu Hacks (see Package Management). To install a new package use the following command : sudo apt-get install <package-name> or use the use the Synaptic package manager found in the menu: System->Administration->Synaptic Package Manager
Here is a list of packages I have added and a description of what they are for:
| Package | Description | | build-essential | GNU C compiler gcc, g++, make
| | libx11-dev | Makes it possible to run X11 applications
| | libdb-4.1 | Needed by Xilinx Coregen
| | alien | Convert rpm package to debian package
| sun-java5-jre
| Latest version of Java from SUN
| sun-java5-plugin
| Latest version of Java plugins
| mdns-scan
| Browse Zeroconf services
| avahi-discover
| Zeroconf support
| avahi-utils
| Zeroconf support
| libdb-4.1 is an old package not easily found. I downloaded the file libdb4.1-4.1.25-9mdk.i586.rpm and then used the program alien to convert the rpm package to a debian package using the command: sudo alien -c libdb4.1-4.1.25-9mdk.i586.rpm. To install the debian package I used the command: sudo dpkg -i libdb4.1-4.1.25-10_i386.deb.
To install the latest version of Java use the following command: sudo apt-get install sun-java5-jre sun-java5-plugin To install Limewire read Torrentfreak. Other must-have tools and programs.
Ubuntu Linux comes standard with the gedit text editor. My favorite text editor for many years is nedit. To download nedit go to Nedit home page. Click the download tab and in the download page click stable binaries and download nedit-5.5-Linux-x86.tar.gz
Just found out about a new text editor called jEdit. It is written in Java and runs on Mac OS X, Linux, Unix and Windows. I am going to try it.
Portable Document Format (PDF) is an open file format created and controlled by Adobe Systems, for representing two-dimensional documents in a device independent and resolution independent fixed-layout document format. Xpdf is an open source PDF viewer for the X Window System and Motif. Xpdf runs on practically any Unix-like operating system. To download Xpdf go to the Xpdf download page. Ubuntu comes with the Evince pdf reader installed.
Default shell
In Ubuntu the default shell for /bin/sh is dash. If you want to use bash in your script files use /bin/bash.
Keyboard mapping
The MacBook keyboard is setup to run Mac OS X and many keys are not defined the way Unix keyboards are setup. It is possible to map the keys any way you want and there is not one standard setup. I will show my setup and you can modify it to fit your needs. The xmodmap program is used to edit and display the keyboard modifier map and keymap table that are used by client applications to convert event keycodes into keysyms. It is usually run from the user's session startup script to configure the keyboard according to personal tastes. To map a key to a symbol you have to find the keycode and the keysum. To every key you can map up to four different symbols. To map key "9" to the four symbols : 9 ) }] you use the following command:
keycode 18 = 9 parenright braceright bracketright To find out the keycode for a key you can use the program xev. Start xev and click in the small window, then hit a key and you will see the keycode and keysum displayed. Put all the mapping commands in a file called .Xmodmap and place this file in your home directory. When you login next time you will be asked to include the .Xmodmap file. You can also setup the mapping by running the command: xmodmap ~/.Xmodmap. To see the current mapping execute : xmodmap -pk. The keysum names can be found in the file keysumdef.h. Remove XK_ before you use the name. Here is my keyboard mapping for my MacBook (I have a Swedish keyboard): | Keycode | Default | Shift | Alt | Alt shift
| 64 (Alt left)
| Mode_switch
|
|
|
| 113 (Alt right)
| Mode_switch
|
|
|
| 11
| 2
| quotedbl " | at @ |
| | 12 | 3 | numbersign #
| asciitilde ~ | | | 13 | 4 | EuroSign €
| dollar $
| | 17
| 8 | parenleft (
| bracketleft [
| braceleft {
| 18
| 9
| parenright )
| bracketright ]
| braceright }
| 35 (¨^)
| backslash
| bar |
|
|
| This is what my .Xmodmap file will look like:
! Map left alt key as mode switch keycode 64 = Mode_switch ! Map right alt key as mode switch keycode 113 = Mode_switch keycode 11 = 2 quotedbl at keycode 12 = 3 numbersign asciitilde keycode 13 = 4 EuroSign dollar keycode 17 = 8 parenleft bracketleft braceleft keycode 18 = 9 parenright bracketright braceright keycode 35 = backslash bar Changing screen resolution
In the latest release of Parallels Desktop (build 3150) this problems has been fixed. Parallels will now set the screen resolution to match the display connected.
When you boot Ubuntu Linux for the first time on your MacBook the maximum screen resolution is set to 1024x768. What happens if you connect an external display with a higher resolution. I have a 23 inch Cinema display (1920x1200) hooked up to my MacBook and without changing the resolution I can't use the fullscreen mode. It is not possible to set the resolution higher than 1024x768 from the menu System->Preferences->Screen Resolution. To change the maximum resolution you have to run the program: sudo dpkg-reconfigure -phigh xserver-xorg. After starting the program a window will be displayed and ask you for a video card driver, leave the vesa marked and then hit Return. In the next window you can enter the video modes to be used . Go down using the arrow down key and when you reach the resolution you would like to use mark it with the space key and then hit Return. The setup will be written to the file /etc/X11/xorg.conf. Next time you boot Ubuntu Linux you will have the maximum resolution changed.
File sharing between Mac OS X and Ubuntu
Parallels has not implemented the same simple file sharing system they have for Windows in Parallels Desktop. But there is a good substitute which I will show you here, the SharePoints program. The SharePoints program lets you setup one or more shared folders in Mac OS X that can be accessed in Ubuntu Linux. Here is a short descriptions on how to use SharePoints to setup file sharing. But first we have to enable personal file sharing and Windows file sharing in the Mac OS system settings:

- In Mac OS X download and install the SharePoints program.
- Start the program.
 - Select a folder to used as a shared folder. I used the Public folder.
- Give it a name (ParallelsDesktop)
- Enable both AppleFileServer sharing and Windows sharing.
- Set the permissions in the popup window

- Allow Windows guests and set inheritance of permissions if needed.
- You may have to set group permissions to r/w to allow writing files to Mac OS X.
- Save the setup.
- Start Ubuntu Linux and open the Networks Server window in the Places menu
- Hopefully you will see the shared folder (SVEN-KE-ANDERSS).
- If you are using VMware double-click the WIndows Network icon.
- Double-click to look inside and read or write files from/to this folder. Voila!

File sharing using secure shell (ssh)
Secure Shell or SSH is a set of standards and an associated network protocol that allows establishing a secure channel between a local and a remote computer. The first thing we have to do on the Mac side is to enable remote login (fjärrinlogging) and to find the ip-address (1x.z.1.y). We should also add the .ssh directory in our home directory.

Here is good description on how to setup and use ssh. Let's follow it.
- Open a terminal in Ubuntu Linux
- Generate a new key. Use the command ssh-keygen -d
- Copy the key to the Mac OS X host using the secure copy cammand.
- scp ~/.ssh/id_dsa.pub 1x.z.1.y:.ssh/authorized_keys2
- We are now ready to test the ssh command: ssh -X 1x.z.1.y or use ssh -X userid@1x.z.1.y to connect to user <userid>.
- We are now remotely logging in to the Mac OS X host and can do almost anything, copying files, starting programs and much more. The DISPLAY variable is automatically set to display windows in the Ubuntu desktop.
- If you execute the command echo $DISPLAY you should see something like this: loacalhost:10.0. If the DISPLAY variable is not set read this link to learn what to do.
- To exit the ssh session use the command: exit or logout
Printing using an Airport Express
I use an Airport Express for wireless printing in Mac OS X. Apple uses a technique they call Bonjour to allow printing using a usb printer connected to their Airport wlan hub. Bonjour lets you create an instant network of computers and and smart devices just by getting them connected to each other. It uses something called Zeroconf or Zero Configuration Networking to setup everything. To print from Ubuntu Linux to a USB printer connected to an Airport Express we will ignore the Zeroconf method and use the standard Common Unix Printing System (CUPS) instead. To use CUPS we first have to find the IP address of the Airport Express unit. When we open the Airport Utility program under Mac OS X and scan the network for Airport Extreme and Airport Express units, we will see the following display:
The IP address of the Airport Express is 10.0.1.200. When we have the IP address we can scan this address to find all open ports. The port scan function built into the Network Tools (System->Administration->Network Tools) utility didn't display all open ports so I decided to install nmap instead. I downloaded and installed nmap-4.20-1.i386.rpm and here is the print out from the program:
==> nmap 10.0.1.200
Starting Nmap 4.20 ( http://insecure.org ) at 2007-03-05 17:30 CET Interesting ports on 10.0.1.200: Not shown: 1693 closed ports PORT STATE SERVICE 53/tcp open domain 5000/tcp open UPnP 9100/tcp open jetdirect 10000/tcp open snet-sensor-mgmt
Nmap finished: 1 IP address (1 host up) scanned in 22.035 seconds
The port 9100 is used for printing and it uses a HP jetdirect printer driver. We are now ready to setup for printing to my Epson Stylus Photo 870. To add a new printer open System->Administration->Printing. Double-click the New Printer icon and follow the instructions.

- Select Network Printer
- Select HP JetDirect
- Enter IP address of Airport Express or Airport Extreme where the printer is connected.
- Port number should be 9100
- Click Forward

- Select printer manufacturer
- Select printer model
- Select driver type
- Click Forward

- Enter printer name or use default name
- Enter descriptive text
- Enter printer location
- Click Apply
Select the Stylus-Photo-870 and make it the default printer (Edit->Make D
Posted at 08:17 am by svenand
Permalink
Customizing Ubuntu Linux 2
More fixesI wanted to add the current directory (.) to my PATH variable and tried to put the command in the .bash_profile file, but it didn't work. When I used the file /etc/profile it did execute. Open the file using the command <sudo nedit /etc/profile> and add the following line : <PATH=.:$PATH> to include the current directory in the PATH variable. When you log in the next time it will be set. If you read the Linux in a Nutshell book it says the following: Bash reads these files: 1. /etc/profile. Executed automatically at login, first. 2. The first file found from this list: ~/.bash_profile, ~/.bash_login, ~/.profile. Executed automatically at login. Second. 3. ~/.bashrc is read by every shell, after the login files.
I coudn't get ~/.bash_profile and ~/.bash_login to work, but ~/.profile was executed. I put the following line <PATH=~/bin:"${PATH}"> in my .profile to add my bin directory to the PATH variable. Use the command <echo $PATH> to find out if all paths have been added.
Top
Posted at 07:34 pm by svenand
Permalink
Posted at 06:47 pm by svenand
Permalink
Posted at 10:36 am by svenand
Permalink
Florida the sunshine state
During a more than one year stay, from October 2000 to January 2002, we (myself, my wife and our daughter) learnt to love Florida, its climate, nature, people and attitude. In September 2000 I was offered a job in US, working for Ericsson Inc as an ASIC designer. A company called Starburst located in Orlando performed the ASIC design project. Working for Starburst was like coming home. You felt like you belonged to the family from the first day you entered the company door. The RTL design was done at Ericsson in Stockholm Sweden and Starburst did all the backend work, synthesizing the design, running timing verification and generating all test vectors. It was a busy but fantastic year and it was sad when we had to leave Florida to return to Sweden in January 2002. When we came to Stockholm it was -10C and two feet of snow on the ground.
What we liked best about Florida were the gorgeous beaches. The first thing we did was to buy the book Florida Beaches to start exploring all the places. The front page of the book says "The Only Guide to the Best Places to Eat, Stay, Swim, and Play on Every Beach in the Sunshine State". With the help of this book we went to beaches all over Florida from the Panhandle down to the Keys.
There are so many beautiful beaches in Florida but here are some we liked the most.
Posted at 04:39 pm by svenand
Permalink
The New York City Marathon
It is a chilly morning on Manhattan when we board the bus at 6 am that will take us to the start of the New York City Marathon on Staten Island. I am one of 35000 runners that is going to run the race. I have had a good breakfast at the restaurant Manhattan Diner and I am ready for the 26.2 miles through five different boroughs; Staten Island, Brooklyn, Bronx, Queens and Manhattan. The bus takes us to Fort Wadsworth, which is located on Staten Island just south of the Verrazano-Narrows Bridge. Then there is a long wait before the start at 10:10 am.
As a New York City Marathon runner, you'll pond more streets in more parts of the city than many natives get to in a lifetime. The start of the race, Verrazano-Narrows Bridge is one of the highlights. The bridge was opened in 1964 and it remains the longest suspension bridge in North America, with towers half as tall as the Empire State Building. The top of bridge is also the highest point of the race, 250 feet above see level. On the other side of the bridge is New York's most populous borough, Brooklyn, home to more than two and a half million people. With more than 11 miles of the marathon in Brooklyn I have plenty of time to enjoy its size and diversity.
From the top of the bridge it's downhill. The tension is gone, the body starts to warm up, the sun is shining, there is no wind and the temperature is 10C. It is a perfect day for a marathon. We descend into Brooklyn and Fourth Avenue, which is a wide boulevard, lined with small stores and apartment buildings, with a church, synagogue or mosque seemingly on every corner. Running is easy and I have plenty of time to watch the surroundings and my fellow runners. I stop at every fluid station to drink. In the beginning I drink only water and after half the marathon a mixture of water and Gatorade. After 10 miles we reach Williamsburgh, one of the world's largest Hasidic Jewish enclaves. Much of Williamsburgh is going through a hipster-artist boom and many new restaurants and cafés are popping up. The Pulaski Bridge will take us to Queens where we stay for only 1.5 miles. The climb over the almost mile-and-a-half-long cantilevered Queensboro Bridge, completed in 1909 gives me a great view of the Manhattan skyline on my left. We enter Manhattan on First Avenue and hundred thousands of cheering spectators. My wife waits for me at 69th Street. A short stop a hug, a kiss and time for taking a few photos.

The neighborhood is now full of restaurants, stores, and modern apartment towers. Some older brownstones and tenements remain north of 90th Street. At 96th Street we enter East Harlem. We'll pass under the Manhattan approach of Moses's Triborough Bridge at 125th Street to cross the Willis Avenue Bridge, a truss swing bridge that dates from 1901. This brings us to the borough of the Bronx and mile 20. I am still in good shape. My legs are a little bit stiffer but there is no pain and no blisters. We stay in Bronx for only one mile and the Madison Avenue Bridge will take us back to Manhattan and Fifth Avenue. The avenue seems to never end and it is small ascent for several miles. At 110th Street the Central Park begins and on the left is the beginning of Manhattan's Museum Mile. When it is two miles left the course enters into the park. The park is hilly and it is up and down all the time. Now all of a sudden my legs start to give up on me. I have to run slower and slower but I force my self not to start walking. When I hear the people cheering at the finishing line I get some extra strength and I cross the finishing line with a big smile. I made it. I finished the New York City Marathon. I get my medal and I am covered with a big warming aluminum blanket. I am so tired and so happy.
All runners have a data chip mounted on one of the shoes. This chip will be read at automatic timing pads and your time will be recorded every 5K. All your split times and your finish time are stored and can be found on the New York City Marathon result page. To see my results, enter my start number 31363.
Posted at 04:06 am by svenand
Permalink
When walking around in New York City you will find wireless hotspots almost everywhere. Every Starbucks cafe has a Wi-Fi connection to connect you to Internet. When we were walking on Prince Street we passed the McNally Robinson bookstore. They had a small cosy cafe where everybody had their laptops on the table and was surfing the web. We walked in and ordered a cappuccino and a tea. The tea was served from a Japanese iron teapot and the cappuccino was the best I have had in New York. I took up my MacBook and in 30 seconds I was connected to Internet.
Posted at 02:24 am by svenand
Permalink
38000 feet above see level
I am sitting in an airplane heading for New York. We have been traveling for 5 hours and still have 3 more to go. I have read all the newspapers and magazines I can find and we have been served a tasteless lunch. Airlines try to save money on everything and the food is no exception. I have tried to watch one of the movies on the 12 by 10 cm display in the seat in front of me but lost interest pretty soon. I have navigated through the menu and read about the Airbus 340 and how to exercise sitting in your seat. Flying is boring.
But what cheered me up was the possibility to connect to Internet using the connexion by Boeing service www.connexionbyboeing.com. The service worked flawlessly and to impress on some of my friends I sent them an email telling them I am in a airplane on my way to New York. It is sad that this service will close down end of this year. I guess it wasn't profitable for Boeing. This blog entry is written and published using this service.
I will run the New York Marathon next Sunday. I am one of almost 600 Swedes that have the chance to take part in this great race. The travel agency arranging this trip is called SpringTime Travel www.springtime.se. Run in Swedish is "springa" which explain the name. I applied for the race more than a year ago and have been running more than 1500 km since than. I have lost 10 kg and was in perfect shape up to a week ago when I caught a cold. The cold is almost gone and race will take place November 5th so there is still some time to recover.
My wife accompanies me and we will spend some days exploring New York before the marathon. Tomorrow night we have a table reserved at the River Cafe www.rivercafe.com
Posted at 05:30 pm by svenand
Permalink
I have decided to start my own blog. I have a lot of spare time after leaving my job at Ericsson the telecommunications company. They gave me 18 months pay so I will stay afloat until I find something else to do. My plan is to start my own company and do consulting work in ASIC and FPGA design. I never wrote a diary in my whole life but the prospect of having hundreds of readers makes it more thrilling. I will write about everything that happens in my life from running the marathon to building my own wine cellar. I will write in English although my mother tongue is Swedish. I would like to make contacts all over the world not only in Sweden. That is why I named my blog "New Horizons".
Welcome to my blog!
Posted at 08:33 pm by svenand
Permalink
|