Laptop Build: Getting xhost + to work

For most of the servers I have to connect to at work I just use telnet or ssh but sometimes I need to run X clients locally such as for the Oracle Universal Installer.

I found that I had to configure KDM in Kubuntu to listen on the network to accept connections to run X. Simply setting the DISPLAY variable on the remote system, typing xhost + on the local system and then running the X application on the remote system would not work.

The key file is /etc/kde3/kdm/kdmrc

In there is a line that says:-

ServerArgsLocal=-nolisten tcp

Just comment this out by putting a # in front of the line and restart X by logging out and back in again. Now you can run remote X clients on your local machine as long as you have run xhost + or to be a bit more secure xhost remotehost where remotehost is the name or IP address of the remote host you are working with. (See man xhost for more details).
Bear in mind that there are some security risks to removeing the -nolisten tcp from KDM and if possible you should look at using X Forwarding over ssh, but then like me you may have systems where this isn’t possible.

Laptop Build: apt-get behind a proxy

We have a Netcache webproxy in use at work and so to get the various apt-get and adept commands to work it is necesary to do some configuration.

There are a few posts on the web about how to do this some, saying you just need to set the environment variable http_proxy, others that you must specify the proxy settings in the file /etc/apt/apt.conf.d/70debconf . For my Kubuntu install I found a mixture of the two was required, more of which anon.

Firstly a word about what the url for your proxy should be: If it is a proxy that requires authentication then it will need to be of the form” using your username, password and the dns name or ip address of the proxy itself and whatever port number your proxy listens on at the end.

N.B. If your password ever expires and/or gets changed then you will need to update the proxy url wherever you set it.

Following is a summary of my findings and what needs to be set where.

  • Adding a line
    export http_proxy=””

    in /etc/bash.bashrc works fine for using apt-get commands from the command line but the graphical tool adept does not appear to read this file or somehow ignores the http_proxy environment variable.
  • For adept to work you must remove the line Acquire::http::proxy “false”; from /etc/apt/apt.conf to get any other apt.conf.d file settings to work.
  • Add in the line
    Acquire::http::proxy “”;

    to the end of /etc/apt/apt.conf.d/70debconf (this file seems to be the “traditional place” to put this setting.)

This got me up and running. I also found the command apt-config dump very useful for displaying the settings that apt-get is going to use. Bear in mind however that for command line apt-get usage the http_proxy environment variable, if it is set, appears to overule whatever Acquire::http::proxy settings you may have in apt.conf.d files.

You can just set the Acquire::http::proxy setting and apt-get from the command line will use this in the same way as adept does but as I like to use wget for fetching the odd file from the ‘net I needed http_proxy set anyway.

Clear as mud? That’s got that sorted then.

Laptop Build: NTFS Resize, First Clean Your Windows

I needed to be able to dual boot my laptop as the VPN client we use “Aventail” is only available for Windows and I would need to be able to log on from home when I am doing out of hours support. The Kubuntu Dapper install caters for this and offers to resize your Windows partition for you.

However when I tried that it failed saying it was unable to resize. I got a similar result when I tried a manual resize using the qtparted partition manager tool.

The reason was when that I had been using the laptop booted in Windows and surprise, surprise it had had some problems shutting down so I had to do a forced power off. This however left the NTFS partition in a non-clean state. As soon as I booted back into Windows and did a full shutdown then the installer resized the Windoww partition no problem. The moral of the story: First clean your Windows.

Practise what you preach….and write it down

Over the last couple of months or so I’ve been using Kubuntu on my laptop at work. I thought it would be a good way to find out if Kubuntu can really hack it in a commercial environment specifically an almost completely proprietary Microsoft one. I administer HP-UX servers so I connect to Unix systems all the time and aside from anything else it is just easier to manage that connectivity from a Linux based system.

So while no-one was looking I set up my Toshiba Tecra P4 256MB 40GB system to be dual boot with Kubuntu Dapper. I encountered quite a few little hurdles to overcome to get the system doing everything I could when it was booted in Windows XP but was able to sort them all out. I had the idea of write a series of posts on what I had to do to tweak Kubuntu so other people could perhaps find the answers easier and quicker than I did and of course it would be a handy reference for me whenever I wanted to do this again.

Well you know how it goes one thing came up then another and I never got to writing stuff down; and serves me write too. When I got my new company laptop, a Dell Latitude 520 Intel Core Duo 1GB 40GB, I found I was floundering around to work out how I did some of the stuff I did before.

So this time I’ve made notes of all the steps I’ve taken to get Kubuntu working how I want and I’m going to post them here over the coming days and/or weeks. In an unusual attempt at brevity I’ll do a separate post for each item. Watch this space………