03/06/2003 Entry: "Techy Geeky - X Windows on OpenBSD"
I got X Windows to work on OpenBSD last night.
Yeah, sure, some of you go "oh, that's EASY!" but for me, it's all still new. I learned by trial and error and almost no useful help on the web that xf86config works on OpenBSD (I could never get it to work on Linux). It's a hand setup, and here are some notes I'd like to pass on for those of you who are frustrated at the lack of adequate FAQs on X Windows and OpenBSD 3.1:
- To configure X-Windows, you had to install it first. I did on OS install, but that may not have occured to you, because by default, no X-Windows stuff is configured.
- When you get the root prompt after everything is installed, type xf86config.
- It will wlak you through the steps. I hit "enter" through most of them, installing defaults except for the monitor refrash rate and horizontal frequency (usualy on a sticker on the back of your monitor) and the video card. It helps to know EXACTLY what video card you have, because they helpfully offer a list.
- If you have a serial mouse, the driver is /dev/cua00 (assuming it's on COM1). This is never explained to you, and I had to wrestle it from some rude people on a board. I also found out for a PS/2 mouse, you need to select wsmouse for "Option protocol", and /dev/wsmouse0 for "Option device." Yeesh. It took me an hour at work to wrestle THAT data from Usenet, which are full of rude and unhelpful people (I didn't ask, I watched others get slapped down for not knowing how to compile their own C code).
- To run, type startx
- It would default to 640 x 480 no matter what I entered in as "primary screen." To change it, hit control alt + ("plus" on the numeric keypad) to cycle through the resolutions.
- I downloaded and/or played with xeyes (pair of eyes looking at you), xworld (picture of Earth from sun), some other stuff, and installed seti@home and samba.
Installing Samba on OpenBSD
Real easy. This is how I do it:
- At prompt, do lynx http://www.samba.org and scroll down and hit your country (in my case, USA)
- It will not have appeared to change, but it did. Scroll down and select "Download."
- Again, the screen does not seem like it changed, but it did. Scroll down until the link "samba-latest.tar.gz" is highlighted, hit enter, when it asks you to download or cancel, hit "D", and then when it asks, hit "save" and save it as samba-latest.tar.gz.
- It will download to your root directory
- When done, quit Lynx with Q. Do ls to see where it is.
- At command prompt, type gunzip samba-latest.tar.gz. It will decompress into a TAR file.
- At command prompt, type tar -xvf samba-latest.tar. It will decompress into a a series of subfolders.
- Type cd [name of directory, like samba-2.2.7.a or something]/source
- In the source directory, type ./configure. Wait a long while.
- When you are back to the command prompt, type make. Wait some more time. This may have taken over 2 hours so far on a 133mhz machine with old hard drives (as I know all to well).
- When you finally get to the command prompt again, all you have to do is one more step. Type make install. This will also take a while, but probably not nearly as long as the first two. Now it's installed!
- Of course, you have to make a smb.conf in /usr/local/samba/lib. Use your favorite editor, although vi is probably all you'll have so far. I won't go into how to use vi, because it's evil and reminds me of working on bessel.umd.edu, but it's like the lowest common denominator in most *nix/BSD installs. Here's a very simple and basic smb.conf you can cut and paste to use:
; This is for global variables, stuff that affects the whole samba server
; Put your computer name here
netbios name = OBSD_SRV1
; Put your WORKGROUP name here
workgroup = HOMELAN
; This is what shows up when you browse: %v is samba version, %L is netbios name
server string = Samba Server %v on %L
; This HAS TO BE SET TO TRUE if you want Windows 95/NT 4.0 on up to accept samba logins or you'll get a "$IPC" error in Windows
encrypt passwords = True
; Where to put your log files. %m is the name of the computer trying to connect to you, and is very handy for troubleshooting
log file = /var/log/samba/log.%m
; This makes samba go a lot faster
socket options = IPTOS_LOWDELAY TCP_NODELAY
; This is an example of a shared directory
; Name of share (that shows up when browsing this computer)
; Description of share
comment = Shared Files on %L
; Path of directory you want to share
path = /usr/pub/files
; Allow people to only read or read/write/delete files?
read only = No
; List of valid users. Note: these people must have an account on the machine PLUS a password in smbpasswd
valid users = admin punkie krakken bobotheclown
; List of users to block (safety measure)
invalid users = root bin daemon nobody named sys tty disk mem kmem users dfarris
Of course, there's a LOT more you can do with this file, I didn't even touch [homes] or [printers] but this is a basic thing to get you started. A full description of how complicated and wonderful you can make this file would be here.