/kb

personal knowledgebase

Archive for August, 2008

Notes on setting up Arch Linux in VirtualBox with Awesome wm

with 8 comments

For several reasons I wanted to have a GNU/Linux system with root access available. In a bright moment I suddenly realized that the simplest way of achieving this was to have a virtual installation on my Macbook.

I chose VirtualBox from Sun as virtualization environment as this is free software (GPL) and Arch Linux as the distribution because I’ve quite some experience with this distribution and it’s easy to create rather minimalistic installs with it.

This walkthrough does not explain how to install Arch Linux in Virtual Box, as this can be considered trivial. The focus is on setting up Arch Linux with the awesome window manager, correct screen resolution and getting access to shared directories in Mac OS.

After installing Arch Linux the first step is to install Xorg and Awesome together with the hwd tool which is used for configuration of Xorg.

pacman -Syu
pacman -S xorg awesome hwd

Then the VirtualBox Guest Additions must be installed in order to be able to set the correct screen resolution for Xorg. In the VirtualBox menu go to DevicesInstall Guest Additions

Perform the following commands as root/sudo:

mount /media/cdrom
bash /media/cdrom/VBoxLinuxAdditions.run

Add 98vboxadd-xclient to .xinitrc for your user and add modules to rc.conf according to Arch Linux Wiki VirtualBox Guide. Then reboot the Arch virtual machine.

In order to configure Xorg an xorg.conf file must be created:

hwd -xa

Edit xorg.conf and set the video driver to vboxvideo and add the resolution 1280×800 to the 16 color depth and remove the other resolutions. Remove all other color depths subsections.

If you want to start Xorg and Awesome and automatically log in at boot, follow the description in the Arch Wiki – Start X at boot and add exec awesome to .xinitrc.

File sharing is easy to set up. First set up the desired folder for sharing by going to DevicesShared Folders in the VirtualBox menu.

Create the folder where you want to mount the share in your Arch filesystem. This name must not be the same as the share name. Now you can mount the share with the following command (as root or sudo):

mount -t vboxsf NAME_OF_THE_SHARE /home/YOUR_USER/MOUNTPOINT

Written by hgrimelid

August 17th, 2008 at 8:54 pm

Posted in General

Tagged with , , ,

Restart Apache

without comments

I always forget how to stop/start/restart Apache (on Ubuntu), so here it is:

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart

Written by hgrimelid

August 12th, 2008 at 12:02 am

Posted in Server

Tagged with ,

Bash shell prompt colors

without comments

Here are the colors available for use in the bash shell prompt:

Black 01;30
Blue 01;34
Brown 01;33
Cyan 01;36
Green 01;32
Red 01;31
Pink 01;35
Yellow 01;33

This is my shell prompt:

PS1='\[\033[01;32m\]\u@\h \[\033[01;35m\]\W \$ \[\033[00m\]'

Which produces output on the form user@computer DIRECTORY $. I use different colors for different computers/users.

Written by hgrimelid

August 8th, 2008 at 12:25 am

Posted in Shell

Tagged with , ,