Thursday, July 06, 2006

Running X11 on Minix

Minix 3 has X11 as one of the optional packages that can be installed. It works very well and I've been using it as on my main machine to test some software I've been porting.

To get started with X11 you'll first need to install the X11 package using 'packman' signed on as root:
$ su
<...enter root password...>
# packman
<...select X11R6 package...>

As part of the install you may notice the X binary has its memory value changed using 'chmem'. Usually this is set to a too large value which can result in X not starting. This will depend on how much physical memory you have on your PC. If you have 512MB you will probably be alright but if you have less then I'd advise manually chaning the value to something smaller. The following command works on my 256MB VMware session:
# chmem =80000000 /usr/X11R6/bin/Xorg

The higher you go the more memory X will require to run and the less free memory you'll have available for other applications. Going too low will cause it to not start at all. To do a quick test to see if X starts I recommend logging in as a non-root account and runing 'startx':
$ startx

Some log information will display on the screen and after 20-30 seconds (depending on the speed of your machine) you will see X appear running the 'twm' window manager and a couple of terminal windows and a clock. You can close it down by pressing CTRL+ALT+BACKSPACE or kill the running X process:
$ ps ax |grep X
174 co 0:00 /bin/sh /usr/X11R6/bin/startx
176 co 0:10 X:0
$ kill 176

Remember that with X you will need have the mouse cursor over the terminal window for it to get focus so you can type into it.

If it doesn't start when running 'startx' you've probably run out of memory. There is log information on the console or in '/usr/log/XLogFile.0.log' which should help track the problem down. Try increasing the 'chmem' value for the '/usr/X11R6/bin/Xorg' program. And have at least 256MB of RAM. With tuning it will run in less but these are the values I've had working.

Another way of running X is to run 'xdm' logged in as 'root'. This will bring up an X session prompting for a username and password. By entering your normal username and password you can then get an X session customised for that user. When you exit X as that user it'll then take you back to the username/password request.

To configure the screen size you need to create a file called '/etc/X11/xorg.conf'. This file contains quite a bit of configuration information and the easiest way to create it is to run 'xorgconfig'. This is a text mode program that will run through a series of questions to create a basic 'xorg.conf' file.

When asked for the device name of the mouse enter '/dev/kbdaux'. You'll need to know things like your monitor's horizontal and vertical refresh rate and the type of video card you have (for VMware installations choose 'vmware' here).

Once the 'xorg.conf' is created there are some simple changes that you can make that are quite useful. The first is enabling the scroll wheel on your mouse if you have one. Edit '/etc/X11/xorg.conf' (using something like 'mined' or 'vim') and search for 'InputDevice'. You should come up with a section like:
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Buttons" "4"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/kdbaux"

Add to this section a line containing 'Option "ZAxisMapping" "4 5"'. So it will now look like:
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Buttons" "4"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Device" "/dev/kdbaux"

If you start X again you can use the scroll wheel. To change the screen size search for the section 'Screen'. My 'Screen' section looks like:
Section "Screen"
Identifier "Screen 1"
Device "** VMware Guest OS (generic) [vmware]"
Monitor "My Monitor"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "1024x768"
ViewPort 0 0
EndSubsection
EndSection

By changing the 'Modes' option to another resolution size and restarting X you will have a different screen size. For more on configuring X any resource for Linux or other operating systems that use it will be useful.

Categories: ,

7 Comments:

Anonymous Anonymous said...

I'm trying Minix but don't like the 4 gig limit on harddrives. Also with over 300 mem memory still have not got X to run.

12:49 PM  
Anonymous Anonymous said...

That's right. One of the things they need desperately is a better file system. I can runX with 256 of ram under VirtualPC. No configuration needed.

6:48 PM  
Blogger Heatfan said...

Thanks, this information helped me to get X running with Minix running under VMWare.

FYI, I had to do the chmem command that you indicated. This avoided the following error which was being logged in /var/log/XLogFile.0.log:

Fatal server error:
mapmem: unable to allocate 16781316 bytes

I configed X for 1280x1024, 24 bit color.

Thank you,
John

9:59 AM  
Blogger Dom said...

i to am struggling to run x on minix with a p3 650 and about 350meg of ram and basic intel chipset,
i will try the tips in this guide thanks :0

8:51 AM  
Anonymous Tufei said...

This tip saved my day getting X up and running. I have a P3-800MHz+256MB box. The installation of X allocate 256MB for it, that makes xdm cannot start.

I then changed to the 80MB, but it seems that X requires at least 128MB allocation. I changed to 192MB again, the xdm could not start either.

I then played with 160MB, and X started finally.

I am using Minix 3.0.2.

Thanks!

4:16 AM  
Anonymous cb88 said...

Why is it that X11 in minix3 needs that much ram? when xvesa will work just fine on computers with even less than 64mb ram. In any case i suppose this will eventually be remedied.

7:22 AM  
Blogger Puntino said...

after changing my virtual memory I noticed that it isn't possible to load your keymap with startX running.
To load my keymap I use the command:
loadkeys italian.map
it sounds weird because when I go back to the terminal (without X server) my keymap setting works fine.

8:28 AM  

Post a Comment

<< Home