andLinux
I discovered andLinux a while
back on slashdot while I was at Stanford. I keep my eyes open for ways
to do linux/x86 development under Windows since, although I used Linux
for development at Stanford, I tend to keep Windows as my primary
desktop environment for development, Microsoft Office, and gaming. I
also found in TAing a class using the simulator that most Students
were interested in being able to do programming assigments on their
Windows laptops. In 2006 and 2007 we suggest the students use a VMware
Player staring with the Browser Appliance image, but in 2008 I put
these instructions together for people wanting to try something
different.
Installation
-
Download the installer from
here
-
Now run the installer andlinux-beta1rc6-minimal.exe
-
At the "Welcome to the andLinux Setup Wizard" screen,
click "Next"
-
At the "License Agreement" screen,
click "I accept this agreement", and then
click "Next"
-
At the "Select Destination Location" screen,
click "Next"
-
At the "andLinux Configuration / Memory Size" screen,
select "1GB",
click "Next"
-
At the "andLinux Configuration / Sound" screen,
click "Next"
-
At the "andLinux Configuration / Startup Type + Panel" screen,
click "Next"
-
At the "andLinux Configuration / Windows File Access" screen,
click "Next"
-
At the "andLinux Configuration / File Sharing Using Samba" screen,
fill out share information, and then
click "Next"
-
At the "Select Start Menu Folder" screen,
click "Next"
-
At the "Select Additional Task" screen,
click "Next"
-
At the "Ready to Install" screen,
click "Install"
-
At the "Completing the andLinux Setup Wizard" screen,
click "Finish"
-
Reboot!
Resize Disk
I found the default andLinux file system to be a little too small. To
expand from 2GB to 4GB, I do the following:
-
Open a command prompt,
Windows-R cmd
-
Stop the andLinux service from the command line by typing,
net stop andLinux
-
Change directories to the andLinux installation directory by typing,
cd C:\Program Files\andLinux
-
Extract the ImageResizeTool.zip to an ImageResizeTool directory using by typing,
7z x -o ImageResizeTool C:\Program Files\andLinux\ImageResizeTool.zip
-
Change directories to the ImageResizeTool directory by typing,
cd ImageResizeTool
-
Run the toporesize.bat program by typing,
toporesize.bat
Then in the program, perform the following steps:
-
"find file" and select "C:\Program Files\andLinux\Drives\base.drv"
-
change size from "2048" to "4033"
-
click "Resize file"
-
Start the andLinux service from the command line by typing,
net start andLinux
When I later tried this on Windows Vista, it seems like the included
toporesize did not work. There seems to be some other people with
these issues, perhaps due to an earlier cygwin1.dll, as discussed
here.
I had to download and use
this later
version of toporesize to work on Vista:
Update to latest
To get the latest bug fixes and security updates, at a root prompt type,
apt-get update; apt-get upgrade
Change from root to normal user
By default the andLinux launcher available as the Windows task bar
status icon runs processes as the root user. Call me traditional, but
I prefer to run as a regular user to avoid accidents. This required a
little bit of doing, as
discussed here.
-
Get a root prompt with the console or terminal
-
Use passwd to set a root password
-
Add a local user with:
adduser <username>
-
Install sudo so you don't need to login as root:
apt-get install sudo
-
I then install emacs so I can have an editor I like:
apt-get install emacs
-
Run visudo to edit /etc/sudoers. Add a line at the end like:
<username> ALL=(ALL) ALL
-
Now we need to
change startwindowsterminalsession
to run as your <username>, not
root. In /usr/bin/X11/startwindowsterminalsession
change:
sux - root ${termcommand} $parameters
to
sux - <username> ${termcommand} $parameters
However, now that things are running as root, we need to have the
linux and windows launcher code to use a port number greater than
1024. I decided to change from 81 to 8081, as discussed
here here.
-
Edit /usr/local/sbin/launcher.pl to change from:
LocalPort => 81
to
LocalPort => 8081
-
Now restart andLinux with a reboot
from the root prompt
-
Then we need to run windows regedit
to add the following:
\\HKEY_LOCAL_MACHINE\SOFTWARE\andLinux.org\Launcher\IP 192.168.11.150 (REG_SZ)
\\HKEY_LOCAL_MACHINE\SOFTWARE\andLinux.org\Launcher\Port 80801 (REG_DWORD)
Note that you will need to add the key for andLinux.org,
Launcher, as well as the new string and dword values for IP
and Port. Make sure the 8081 is in entered in decimal, not the
default hexidecimal.
Installing software
I prefer to use the command line tools to install new packages. For example, to install emacs as your non-root user:
sudo apt-get install emacs
However, you can also used the GUI synaptic:
sudo synaptic
To find what package contains a specifical file or command you are
looking for you can use apt-file. For
example, to locate what package has the Perl XML DOM parser library
file XML/DOM.pm:
sudo apt-get install apt-file
sudo apt-file update
sudo apt-file find XML/DOM.pm
Fixing terminal to work with Alt/Meta for Emacs et al.
Select "Terminal | Edit | Preferences | Shortcuts | Menubar Access | Disable all menu access keys"
Windows mount
reference
http://andlinux.org/forum/viewtopic.php?p=63&sid=c22295fe5271be1b2471df261b6cdb7e
add to /etc/fstab
//windows-host/MyShare /mnt/win smbfs auto,credentials=/etc/smbpasswd,iocharset=iso8859-1,codepage=cp437 0 0
note that windows-host is defined in /etc/hosts as an IP to access your local machine.
Control Panel\Network and Sharing Center
Unidentified Network (Public network)
Access Local Only
Conneciton TAP-Colinux
click "Customize"
change "Public" to "Private"
"sudo reboot"
TCC simulator installation
To install the minimal utilities to build and run the simulator:
sudo apt-get -y install subversion g++ binutils-dev make
To generate ~/.ssh/id_pub.rsa to add to your tcc.stanford.edu:.ssh/authorized_keys file to avoid login prompts on svn+ssh access:
ssh-keygen
To checkout the TCC svn trunk to a directory called tcc:
svn co -N svn+ssh://tcc.stanford.edu/TCC/svnrepos/trunk tcc
To checkout the main simulator files and do a test build:
cd tcc
svn up bin test-less simulator
cd simulator
./configure
make test
cd ..
JikesRVM build for the simulator
To setup a JikesRVM environment to run SPECjbb2000:
svn up jikesrvm-sim SPECjbb2000
sudo apt-get install libxml-dom-perl rsync bzip2 patch jikes
Note that we need to do a one time sync of some /TCC files that setup-rvm-sim expects to find:
sudo mkdir -p /TCC/Software/JikesRVM
sudo chown -R bdc /TCC
mkdir /TCC/Software/JikesRVM
rsync -a -P --exclude JikesRVM/jikesrvm-2005-12-09-03-00-00 tcc.stanford.edu:/TCC/Software/JikesRVM /TCC/Software
Default build of JikesRVM of the simulator
cd jikesrvm-sim
./setup-rvm-sim.pl
LaTeX setup for ACM and IEEE paper templates
The common templates we use require quite a few extra texlive packages:
sudo apt-get install texlive-latex-base texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra texlive-extra-utils xpdf evince