Friday 19 August 2011

DNS and DHCP

For some reason I hadn't enabled the ability for DHCPD to update my internal DNS server when a new client joined the network, so I decided to do that.

The process is quite simple, you generate a key which you give to both DHCP and DNS and they hash out the communication.

However after I did that I noticed I was getting an error:

Aug 19 17:00:56 server01 dhcpd: if iPod-touch.mydomain.org IN A rrset doesn't exist add iPod-touch.mydomain.org 3600 IN A 192.168.1.140: timed out.
Aug 19 17:00:56 server01 dhcpd: DHCPREQUEST for 192.168.1.140 from 00:26:bb:a1:cf:a0 (iPod-touch) via eth1
Aug 19 17:00:56 server01 dhcpd: DHCPACK on 192.168.1.140 to 00:26:bb:a1:cf:a0 (iPod-touch) via eth1

I Googled for any signs of what this could mean and I didn't find anything. There weren't too many people reporting the same issue, so I guess there wasn't that much to it.

I finally did an strace on the named server and managed to catch that the server was getting an access denied error. I looked at my bind directory and realized it was owned by root as were the files... I quickly changed this to the bind user and voila! problem solved.

-P

PS - many people may wonder why I would want to do this in the first place, do I REALLY have that many machines or ... anyway, the answer is it's "because I can".

Monday 11 April 2011

VMWare MKS plugin on 64bit Ubuntu with nspluginwrapper

Since I've been running Ubuntu 64bit at work I've found a few things that still don't work like I'd like.

We use VMWare Lab Manager which gives you access to a console for the VMs that you deploy. However, the plugin that is provided by VMWare is only a 32bit app and due to that it doesn't seem to work when you install it.

Every time you go to the console, you get a black screen which allows you to install the plugin even though you already installed it.

However, there is a solution. You can go ahead and install the MKS plugin as usual, restart your browser and make sure that the plugin shows in the Extensions.

Then shutdown the browser (so you might want to print this blog entry or copy paste to gedit) and you can then try using nspluginwrapper to install it.

I suggest you run it like this:

/usr/bin/nspluginwrapper -v -i $HOME/.mozilla/firefox/xxxxxx.default/extensions/VMwareMKSNPRTPlugin@vmware.com/plugins/libnprtmks.so

Where xxxxx.default is your profile.

You can use sudo if you want, but this way it installs it into your .mozilla/plugins/ directory. The reason for the -v is so that you get verbose output if the installation fails (see below.)

*** NSPlugin Viewer *** ERROR: libexpat.so.0: cannot open shared object file: No such file or directory
nspluginwrapper: no appropriate viewer found for /home/USER/.mozilla/firefox/xxxxxxx.default/extensions/VMwareMKSNPRTPlugin@vmware.com/plugins/libnprtmks.so

Now what problems can you encounter? Well, in my case I found that I needed libexpat.so.0 as you can see above. Since this library isn't available to install, I installed libexpat.so.1 (sudo apt-get install libexpat1) and I just created a symbolic link in the /lib32 directory like this:

sudo ln -s /lib32/libexpat.so.1 /lib32/libexpat.so.0

I then ran it again and it was successful.

Now I can start my browser go to the console and voila, it works.

I'm not sure if there are other libraries that are needed, but at least by doing this I managed to get it working.

Getting this plugin to work with nspluginwrapper has given me hope that any other plugin that I cannot get working out-of-the-box will work through nspluginwrapper as long as I have the -v to be able to find the libraries that are missing.

Good luck!

-P

Thursday 31 March 2011

Dual Booting Blues?

It's been a while since I wrote anything. Not because I didn't have anything to say, just I didn't have the time to really write anything.

However, today I decided I would write THIS down. It's information that was gleaned from different sources and finally helped work the issue out. None of the places I read had the FULL steps to fix the issue. Hopefully this will help a poor soul.

Yesterday, someone installed Ubuntu on their system when I wasn't locally around to help out. They've installed Ubuntu on their home PC and on another desktop without really encountering any issues. That wasn't the case yesterday.

Somehow, the installation had frozen and they had therefore canceled it in mid-stride. They then reran the installer but manually selected the partition where they wanted to install (the one previously created/resized during the first install attempt.) Luckily they didn't wipe the Windows partition which they still needed, however booting into the machine was now not possible.

Investigating the issue I discovered that os-prober didn't see the Windows files it needed to boot. I went ahead and updated the system in case there were any fixes included in one of the updates. However, it seemed that the boot information for Windows was gone.

I was going to run something to recover the boot manager, but I wanted to be there to be able to troubleshoot things.

When I arrived at the office, I found out that they had taken things into their own hands and had used a Windows 7 install disk to "fix the boot manager" which in turn broke grub2 and now he couldn't boot into Windows 7 OR Ubuntu.

He could boot into the USB stick with Ubuntu, so quickly I did the following.

sudo fdisk -l
sudo mount /dev/sda5 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
update-grub
grub-install /dev/sda
grub-install --recheck /dev/sda
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
sudo reboot

This fixed the grub bootloader and we were now able to boot into Linux once more. However, During the update-grub, the Windows partition wasn't added to the loader. (This information came from Ubuntu's Help site.

Once in Ubuntu, I opened a terminal and did:

sudo fdisk -l
sudo mount -t ntfs /dev/sda1 /mnt
ls /mnt/boot
os-prober
sudo update-grub
sudo umount /mnt
sudo reboot

Ok, in reality I initially mounted the Windows partition and checked that the files which were missing (BCD, BCD.log, etc) were there. Then I unmounted the Windows partition, ran os-prober which didn't detect Windows. So I then mounted the partition, re-ran os-prober and it DID find the Windows installation. At that point I ran update-grub which added the Windows information to the grub.cfg file and voila!

The things I had to "put together" were:

1. os-prober seems to need the Windows partition mounted when you run it manually. Not sure why it doesn't seem to need it when Ubuntu runs updates. Maybe it takes care of that itself.
2. The Windows 7 (and Vista) Boot Manager needs the files in the C:\boot\ directory to boot and os-prober needs those files to detect Windows 7/Vista.

I hope these steps help people out.

-P