//burnz.blog

Entries tagged as ‘Ubuntu’

How to change the hostname in Ubuntu

February 26, 2009 · 7 Comments

To change hostname in Ubuntu or any Debian variant Linux, modify the /etc/hostname and /etc/hosts.

sudo vi /etc/hostname

Change the old hostname to a new hostname.

sudo vi /etc/hosts

Also, change the oldhostname to a new hostname,

192.168.1.100               newhostname

After done, changing the /etc/hostname and /etc/hosts, you need to restart the hostname service.

sudo /etc/init.d/hostname.sh stop

sudo /etc/init.d/hostname.sh start

And then you log out from the shell and log in back. Once logged in, type

hostname

to check on the changes you have made for the hostname.

Categories: Linux / Unix · Tutorial · Ubuntu
Tagged:

Ubuntu auto shutdown due to high CPU temperature

February 23, 2009 · 5 Comments

Ubuntu

I use a laptop with Ubuntu 8.10 installed at work. While running the some high process, the CPU temperature get really high and its automatically shutdown the system. This thing happen every 2 or 3 days and its really annoying. The syslog showed the following error message:

ACPI: Critical trip point
Critical temperature reached (100 C), shutting down.

I know it is a safety feature, but really, I can’t afford to keep having the system shutdown while my system doing something important. My system fans are working but for whatever reason my CPU temp exceeds the critical threshold of 99C. On some systems you can see what your threshold is within the BIOS and even edit it but not on this one. So what’s a frustrated developer supposed to do? Well, it turns out you can tell you system to ignore the high temp threshold and to just keep on chugging along. NOTE: This isn’t the best advice I ever gave, if you do this then fry your CPU don’t come bitching to me.

sudo vi /etc/modprobe.d/options

Go to the last line of the file and add:
options thermal nocrt=1

Save the file.

Once you have this option set you need to reconfigure the kernel to pick up these changes, enter the following command:

sudo dpkg-reconfigure linux-image-$(uname -r)

This will update your kernel and then tell you to restart when it is done. Once you restart the system, type the following command the verfiy:

cat /proc/acpi/thermal_zone/*/*

It should display something similar like below.

<setting not supported>
<polling disabled>
state:                   ok
temperature:             52 C
critical (S5):           99 C <disabled>

Now your system won’t restart when the critical heat point is passed. Again, don’t blame me if you hurt your machine by doing this.

Categories: Linux / Unix · Tutorial · Ubuntu
Tagged: , ,

How to setup headless Sun xVM VirtualBox on Ubuntu server

September 4, 2008 · 12 Comments

The steps are not too difficult but I did have to find a few places for information. Search on the forum turn up nothing on this subject so hopefully this HOWTO would be helpful to someone out there.

Note: This is not using the OSE version.

Background:
VirtualBox has a very good GUI running on the host to manage guest OS. However when running a server, we typically do not want to run X on it. Fortunately VirtualBox has commandline tools to manage guest systems. It also provides the VirtualBox Remote Desktop Protocol (VRDP) to allow connection to the guest remotely.

Clarification of terms used:
Host – refers to the machine we are trying to install VirtualBox.
Guest – the VirtualBox guest system that is setup on the host.
Remote – the PC that we are working on to connect to the host via SSH.

This setup was done on a fresh install of Ubuntu Server 8.04 with openssh-server installed.

All the following steps are done by SSH into the host from a remote (I’m using Windows for now).

1. Get required packages
Download the Ubuntu package for VirtualBox from http://www.sun.com/software/products/virtualbox/get.jsp

wget “download link here” -O virtualbox_1.6.2-31466_Ubuntu_hardy_i386.deb

We are using the non-OSE version here.

The manual from http://www.virtualbox.org/wiki/Downloads is also very useful.

2. Installation

sudo dpkg -i virtualbox_1.6.2-31466_Ubuntu_hardy_i386.deb

This will generate a bunch of dependencies. Fix them with

sudo apt-get -f upgrade

3. Decide on user, disk files location

First decide which user you want to run VirtualBox. Add this user to the vboxusers group.

sudo usermod -a -G vboxusers vboxuser

By default VirtualBox creates the directory .VirtualBox on the user home directory and put all the config and disk file there. In my setup, I put the disk files in /var/vbox as I had created a large partition for this purpose.

4. Install a guest OS

You will need an iso for the guest OS install CD. Copy or download it to the host. For example we will just use ubuntu-8.04-server-i386.iso

-create a vm

VBoxManage createvm -name ubuntu -register

-config vm

VBoxManage modifyvm ubuntu -memory “256MB” -acpi on -boot1 dvd -nic1 nat

-create a disk

VBoxManage createvdi -filename “/var/vbox/ubuntu.vdi” -size 5000 -register

-add disk to vm

VBoxManage modifyvm ubuntu -hda “/var/vbox/ubuntu.vdi”

-register an install iso

VBoxManage registerimage dvd /var/vbox/ubuntu-8.04-server-i38.iso

-mount iso on vm

VBoxManage modifyvm ubuntu -dvd /var/vbox/ubuntu-8.04-server-i38.iso

-start the vm with port

VBoxHeadless -startvm ubuntu -p 3389 &

If you are running just 1 guest, the -p 3389 is optional. For more than 1 guest, it has to listen to different port.

5. Connect from remote

Since my desktop is still Windows, I use Remote Desktop Connection. (On XP, Start>All Programs>Accessories>Communications)

For Mac, use http://www.microsoft.com/mac/products/remote-desktop/
For Ubuntu, look at http://ubuntuforums.org/showthread.php?t=824710

Just fill in the IP of your host (or IP:port if not the default) and you should see the Ubuntu installation waiting for you.

Other useful commands:

VBoxManage controlvm ubuntu poweroff
VBoxManage controlvm ubuntu reset

Getting Ubuntu Server to run in VirtualBox

After installation and restarting, you may find that the boot up hang with this error

This kernel requires the following features not present on the CPU: 0:6

To fix this, do the following:

  1. Reset the guest
  2. Hit F12 to choose to boot from the CD. (It goes by pretty quickly, reset again if you miss it.)
  3. Select Rescue a broken system
  4. After going through the install screens you will get a command prompt. Select to run it on the root system.
  5. Install the virtual linux-virtual kernel

apt-get install linux-virtual

6. Reboot and this should fix the restart.

Upgrading kernel
If the kernel on the host is upgraded, the VirtualBox kernel module need to be re-compiled. Do the following steps:

  1. apt-get install make gcc linux-headers-2.6.24-19-server (other kernel header, check uname -a)
  2. /etc/init.d/vboxdrv setup

It should recompile the VirtualBox module and everything should be working again.

[ Source: kcnnc from Ubuntu Forum ]

Categories: Linux / Unix · Software · Tutorial · Ubuntu
Tagged: , , ,

Fix date and time in Ubuntu

June 20, 2008 · 14 Comments

Dual-booting with Ubuntu and Windows sometimes giving a problem with date and time in Ubuntu. This is a well-established problem when dual-booting, since Linux assumes the hardware clock represents UTC, whereas Windows assumes the hardware clock represents local time. Luckily Linux provides ways to change this to fix it.

If you go into your clock settings, I think you can select between setting the hardware as either UTC or local time. Try switching that, and then adjust the time and see if it “sticks.”

If not, you can do this via the commandline in Linux :-

  1. In Linux, set the date and time to what it currently is. For example if it’s 10:20am local time:
    user@server:~$ sudo date -s 10:20
  2. Then update the hardware clock accordingly, and force this to be considered “localtime”:
    user@server:~$ sudo /sbin/hwclock --systohc --localtime
  3. Check to make sure it looks right:
    user@server:~$ sudo /sbin/hwclock --localtime
  4. Sync between hardware clock and system clock:
    user@server:~$ sudo /sbin/hwclock --hctosys --localtime

Now Linux should consider the clock to be “localtime”, which should be identical to what Windows is doing. So after rebooting into Windows, the time should look right.

Hope that helps.

Categories: Linux / Unix · Tutorial
Tagged: , , ,

Fix for No Splash in Ubuntu 7.10

March 31, 2008 · Leave a Comment

After installing Ubuntu 7.10 there is no splash screen displayed at startup nor at shutdown. I just get a ‘Signal Out of Range’ message from my monitor.

A program called usplash controls this process, so I looked into it’s configuration, the values were totally off for my monitor, which uses a resolution of 1280 x 800.

By default the file looks like:
$ sudo cat /etc/usplash.conf
# Usplash configuration file
xres=1280
yres=1024

I edited the file:
$ sudo gedit /etc/usplash.conf

I changed the xres to: xres=1080 and the yres to: yres=800. Then I reconfigured the usplash program with the new settings.
$ sudo dpkg-reconfigure usplash

Problem fixed, now the splash image displays both at startup and shutdown.

Categories: Linux / Unix · Tutorial
Tagged: ,

Restore GRUB in Ubuntu

November 23, 2007 · Leave a Comment

Restore GRUB quite simple in Ubuntu, instead going through all the “gain root access” and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.

Here are the steps:

  1. Boot your computer up with Ubuntu CD
  2. Go through all the process until you reach “[!!!] Disk Partition”
  3. Select Manual Partition
  4. Mount your appropriate linux partions
    /
    /boot
    swap
  5. DO NOT FORMAT THEM.
  6. Finish the manual partition
  7. Say “Yes” when it asks you to save the changes
  8. It will give you errors saying that “the system couldn’t install …..” after that
  9. Ignore them, keep select “continue” until you get back to the Ubuntu installation menu
  10. Jump to “Install Grub ….”
  11. Once it is finished, just restart your computer

Another way to restore GRUB, for advance users.

  1. Pop in the Live CD, boot from it until you reach the desktop.
  2. Open a terminal window or switch to a tty.
  3. Type “grub”
  4. Type “root (hd0,6)”, or whatever your hard disk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
  5. Type “setup (hd0)”, or whatever your hard disk number is.
  6. Quit grub by typing “quit”.
  7. Reboot.

Good luck!!!

Categories: Linux / Unix · Tutorial
Tagged: , ,

Ubuntu Gutsy Gibbon (Ubuntu 7.10) – The Perfect Server Setup

October 19, 2007 · Leave a Comment

Ubuntu LogoThis tutorial shows how to set up a Ubuntu Gutsy Gibbon (Ubuntu 7.10) based server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Courier POP3/IMAP, Quota, Firewall, etc.

[ Source: HowtoForge ]

Categories: Linux / Unix · Software
Tagged: , ,

Howto Easily run an Xserver under Windows

October 16, 2007 · 1 Comment

Sometimes, you need to connect from Windows to a Unix or Linux system just to run a specific software. For example, if you want to run some Linux open source program under windows and you have a Linux machine in your network or accessible from the Internet, there is an easy way to do it: Xming.

The installation is pretty forward. Once installed, the easiest way to use is to run it straight away. You have an X icon on your windows desktop, run it.

Then you need a remote terminal connection software, the best open source is Putty. t is an executable, just download it and lunch it. Depending from the remote terminal service that is running on your server, configure Putty to use it. I suggest OpenSSH. You have also to configure the X11 Forwarding setting in Putty to forward the X session to your windows machine IP address. Done.

  1. Get Putty and Xming. Note, both of these applications are “portable” and can be copied to a thumbdrive and run on any machine you may have access to.
  2. Launch Xming and select the style you wish to display the X server output.
    Hint:
    Select Multiple Windows and your X applications will look like they were launched from Windows. Leave Display number set to 0
  3. Click Next. Select Start No Client and click Next.
  4. On Server Options, check the box title Disable Server Control. Leaving the box unchecked can give you an “unspecified protocol error” later down the road.
  5. Click Next and save your configuration. This will create a quick way to launch Xming later.
  6. Once you see the X in the systray you can launch Putty. Enter the address of the machine you are trying to connect to. Be sure to select SSH as the protocol.
  7. Now connect. With luck you will be asked to log in. Enter your credentials.
  8. Now to actually forward the ports. There is an option in Putty for this but it never seems to work for me.. so I type:
    DISPLAY=your.windows.ip.address:0.0
    export DISPLAY
  9. Done.

To test it, type:

xclock &

and the analog clock should be appear. Try

mozilla-firefox &

and your web browser should appear. Looking for your email? Try

evolution &

When you’re done, type exit in Putty and it all goes away!

You won’t be able to see your desktop, so you’ll have to know the names of the apps you want to run. To see the desktop requires XDMCP, which is easy to set up but is NOT secure.

Categories: Linux / Unix · Software · Tutorial
Tagged: , , , , ,

Review of Ubuntu 7.10 (gutsy) new features and changes

September 27, 2007 · Leave a Comment

Startup and shutdown screens won’t blink any more, so no more watching of a boring black screen even for a second. Desktop theme received some minor updates: some pixels changed at the mouse cursors to make them more eye pleasant. Evolution is now displaying popup at the tray in case of a message arrival. In the file manager an image thumbnails will be automatically rotated if they were taken with a camera. Buttons of the ‘windows list’ applet in Ubuntu 7.10 will stay they original size despite a change of a window title, for example in case of web browser tab change. The very impressive Deskbar applet is initially activated. Microsoft ntfs file system support should be available for reading and writing by default (by ntfs-3g driver using FUSE). Additional set of utilities for manipulation with ntfs partitions such as format, resize, undelete and etc. is accessible via ‘ntfsprogs’ package. Read more >>

[ Source: Tolero’s tech notes ]

Categories: Linux / Unix · Security · Software
Tagged: , , ,