extra OpenBSD configuration

These are steps for enabling an interface and sshd at start-up. These apply when you didn't configure/enable them during installation.

Network Interface
1) Create the file /etc/hostname.interface_name. In my case, interface_name is vr0. So, the file would be /etc/hostname.vr0
2) Add the line this line to the file:

inet 192.168.255.1 255.255.0.0

sshd
1) edit /etc/rc.conf.local, change sshd_flags=NO to sshd_flags=""

HP500 Notebook running on FreeBSD6.2

I've been working on running FreeBSD6.2 on my laptop. I've got most of the hardware working properly. All except for the wireless adapter which is not working as it's supposed to.

Anyway, below are some of the configurations I made to get things up and running.

ACPI
Seeing ACPI-related error messages during boot-up is annoying. To turn this off, just add the following line to /boot/loader.conf

hint.acpi.0.disabled="1"


Audio
The notebook comes with an Intel ICH audio device. To load the correct kernel driver during boot-up, add the follwing to /boot/loader.conf

snd_ich_load="YES"


Video
To get the maximum possible resolution when running X windows, just do the following:

1) install 915resolution port

# cd /usr/ports/sysutils/915resolution
# make install clean

2) add the following lines to /etc/rc.conf

i915resolution_enable="YES"
i915resolution_modes="38 49 58"
i915resolution_width="1280"
i915resolution_height="800"

3) run /usr/local/etc/rc.d/915resolution
4) reconfigure X to apply the new settings


TODO:
Wireless support. (I've installed the the iwi port but things are not working properly).


This is what I ran into while installing Joomla! on Ubuntu

I was trying to install Joomla! on my Ubuntu box and ran into this error when I tried to install libapache2-mod-php5:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libapache2-mod-php5: Depends: php5-common (= 5.2.1-0ubuntu1) but 5.2.1-0ubuntu1.2 is to be installed
E: Broken packages


I googled for possible fixes but couldn't find any. So, out of desperation, I tried the following:


sudo apt-get update
sudo apt-get install libapache2-mod-php5


It worked. But, I sure as hell don't know why. Sometimes, I can't help but think that apt-get is a bit retarded -OR- maybe it's just me.

What to do if you forget your MySQL admin password

1) run mysql daemon with these options:


sudo /usr/sbin/mysqld --skip-grant-tables --user=root


2) run mysql client and enter the following commands:

mysql> USE mysql
mysql> UPDATE user SET password=password("mysqlpass*0987") WHERE user="root";
mysql> flush privileges;
mysql> exit


3) restart mysql

A more complete explanation is found here

Installing VMware-Server on my AMD64 box running on Ubuntu Feisty

I successfully installed VMware-Server on my laptop using this link. I thought that THAT was it. So, I decided to follow the same instructions - this time - on an AMD64 machine(the on I use at work) with a not-so-fresh Ubuntu install. Unfortunately, I ran into some tiny bumps along the way.

I don't know why these errors occurred in the first place AND I can't give a valid explanation how these fixes(the ones I found by googling) got the installation process to work. But, if you're in a hurry, then these tips might be helpful.

First, I encountered an error while compiling:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

I got this fixed by installing build-essential. This is definitely something that I should always remember everytime I need to build anything, at least only if I'm on Ubuntu.

sudo apt-get install build-essentail


Second, errors occurred when vmware was trying to generate SSL keys. It seems to look for `/etc/vmware/ssl/rui.key` and `/etc/vmware/ssl/rui.crt`.

The fix is quite obvious but at that time it took me a couple of minutes of googling just to find a suitable fix. And, the fix is just to create those files by using `touch`.

sudo touch /etc/vmware/ssl/rui.key
sudo touch /etc/vmware/ssl/rui.crt


Lastly, I encountered an error after I input my serial number. I was pretty sure that it's valid. My hunch was that something else was causing the vmware installer to flag my serial number as invalid. So again, I turned to ask guidance from the Almighty... Google.

Lo and behold, all I needed to do was to install the ia32-libs package.

sudo apt-get install ia32-libs

That's it. I currently have an OpenBSD4.1 guest OS on my VMware-Server.

mounting a UFS formatted flash disk on a Linux box

I have a USB flash disk with a UFS file system. If your asking why my flash disk is on UFS, well, it's a long story and completely irrelevant to this post. Here's how I got it mounted on my laptop running on Ubuntu.


I successfully mounted it on my lappy using:
sudo mount -t ufs -o ro,ufstype=44bsd /dev/sdb1 /mnt

The are lots of ufstype options: old, 44bsd, 5xbsd, ufs2, nextstep... just to name a few. If you don't specify a ufstype option it will default to old, which in my case didn't work. Then, I tried ufs2 and it also failed.

I recalled using the O1 option when I formatted my flash disk, like this:
newfs -O1 /dev/da0s1a

The O1 option is used for ufs1 format. So, I tried 44bsd because it's the closest thing to old that isn't ufs2. Heh. Well, 44bsd did the trick. I didn't bother testing 5xbsd. But, I'm guessing it would work too.

Multiple NICs with netgraph

I needed to simulate multiple PPPoE clients using one NIC. After googling, I was quite convinced that I could do it through netgraph. After more googling, I found this and this and this, which made me come up with the set of commands - found below - to create multiple virtual NICs, each having unique MAC addresses.

host1# kldload ng_ether
host1# kldload ng_eiface
host1# kldload ng_brdige
host1# ifconfig xl0 delete
host1# ifconfig xl0 down
host1# ngctl
Available commands:
config get or set configuration of node at
connect Connects hook of the node at to
debug Get/set debugging verbosity level
dot Produce a GraphViz (.dot) of the entire netgraph.
help Show command summary or get more help on a specific command
list Show information about all nodes
mkpeer Create and connect a new node to the node at "path"
msg Send a netgraph control message to the node at "path"
name Assign name to the node at
read Read and execute commands from a file
rmhook Disconnect hook "hook" of the node at "path"
show Show information about the node at
shutdown Shutdown the node at
status Get human readable status information from the node at
types Show information about all installed node types
write Send a data packet down the hook named by "hook".
quit Exit program
+ mkpeer xl0: bridge lower link0
+ name xl0:lower bnet0
+ mkpeer bnet0: eiface link1
+ name bnet0:link1 vif0
+ ngctl msg xl0: setautosrc 0
+ ngctl msg xl0: setpromisc 1
+ quit
host1# ifconfig ngeth0 link 00:00:00:00:00:0F
host1# ifconfig ngeth0 up
host1# ifconfig xl0 up

I used my xl0 interface as the parent interface the virtual interface (ngeth0). Doing an ifconfig would show the following:
host1# ifconfig
sis0: flags=8843 mtu 1500
options=8
inet6 fe80::211:d8ff:fe79:f0%sis0 prefixlen 64 scopeid 0x1
inet 10.3.1.143 netmask 0xfff00000 broadcast 10.15.255.255
inet6 fec0:ec8:4008:102:211:d8ff:fe79:f0 prefixlen 64 autoconf
inet6 2001:ec8:4008:102:211:d8ff:fe79:f0 prefixlen 64 autoconf
ether 00:11:d8:79:00:f0
media: Ethernet autoselect (100baseTX )
status: active
xl0: flags=8943 mtu 1500
options=9
inet6 fe80::210:5aff:fe9d:5ea9%xl0 prefixlen 64 scopeid 0x2
ether 00:10:5a:9d:5e:a9
media: Ethernet autoselect (100baseTX )
status: active
lo0: flags=8049 mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
pfsync0: flags=0<> mtu 2020
syncpeer: 224.0.0.240 maxupd: 128
pflog0: flags=0<> mtu 33208
ngeth0: flags=8843 mtu 1500
inet6 fe80::200:ff:fe00:f%ngeth0 prefixlen 64 scopeid 0x6
ether 00:00:00:00:00:0f
host1#
Caveats:
  1. The default limit to the number of virtual interfaces - ngeth(N) - interfaces that can be attched to the netgraph bridge(bnet0) is 31.
  2. If you do this, you cannot assign an IP Address to the physical interface, xl0 in my example.
  3. AFAIK, netgraph is only found in FreeBSD.

Installing OpenBSD3.7 as a guest OS on a VMware Server

If you have tried installing any OS on VMware before and if you have tried installing OpenBSD on a real box, AND, you need to install OpenBSD on VMware, then read on...

There are a couple of important things to note/consider during installation. Let's just say that I ran into a some of "gotchas" while doing the install. I hope that this would prevent you or me (in case I need to do this again in the future) from the hassle of running into these simple but pesky problems.


[ONE: Prepare a new virtual machine]

When you're prompted to choose the "Guest OS", click on "Other". And then, on the drop down menu, choose "FreeBSD" for an i386 target platform or "FreeBSD 64-bit" for... well, I don't have to state the obvious. This allows you to maximize theoptimizations made by VMware for your taget OS (I'm just saying this because it sounds good but I honestly don't have any basis for that particular claim).

That's it for the first part. All the remaining options are yours to decide.


[TWO: OpenBSD3.7 Installation]

Installing Packages:

OpenBSD doesn't distribute official ISOs. However, there are available ISOs made by certain individuals which you can download and safely install. The problem with these ISOs is that they don't really follow a standard directory structure.

During installation, you will be prompted to specify the directory where the packages are located. Therefore, before you start installing OpenBSD, you need to know where the packages are located.

To do this you need to mount the ISO. On linux I issued the command:

`mount -o loop /path/to/ISO/file /path/to/mount/directory`


Making Partitions:

By default, the "a" partition is already created. This does not happen when you install OpenBSD on a real box. On a real box install, you only get the "c" partition (assuming you don't have any other OS installed) at first.

As a work around, you need to remove the "a" partition then add it again using your intended settings (it's retarded, I know). If you don't, then your installation will surely break.

After that, you can add the other remaining partitions.