Thursday, September 27, 2007

installing vserver in FC6

I had a project where I needed lot of virtual machines. I looked through the systems that are available, and found vserver to be the most suitable one for me. There are advantages and disadvantages of using vserver. On the positive side I can create a large number a of VMs with little hardware resources. This is to me the most important. On the other hand I had to compromise by having to settle to have all my VMs as same as my host OS. vserver have only one kernel so if for example my host is FC6 so is all my VMs. I dont think vserver is supported by Windows, but almost all LINUX flavors do.

'http://linux-vserver.org/Installation_on_Fedora' is a good place to find out how to install vserver on FC6, or any FC for that matter. I followed it and its very helpful, though I ran into some problems and had to fight through them, fun times :).

I had yum not working properly most of the time and had to reinstall couple of times...
then the most important thing when you remove the current kernel and install the new kernel (vserver enabled kernel).
1. check whether its installing during yum; see whether its going to the correct repo. then its about 16M
2. go to /boot and check whether all the files are relating to the new kernel installed.
3. most important, for me it didnt change the 'menu.list' file so I had to do it manually
*title is just the name, this is shown during boot time
*kernel should be given the file with 'vmlinuz' last part of it 'root=...' leave it alone
*initrd should have the img file
now reboot.
keep your fingers crossed hopefully you dont have to discover anything...

Wednesday, September 26, 2007

giving sudo permisions to user

its good practice not to work as 'root' all the time. Use root only when you really need to (root is too powerful be used as a regular user). Ubuntu by default will not let you login as 'root'. It always uses 'sudo' command. But this is not the case with FC, in FC you can be root. So better practice lets give the user sudo permissions.

Users who can use 'sudo' command is controlled by the sudoers file in /etc. you have to add the user to this file with level of permissions you are willing to give him. In my case I need to do everything so the following command will make me a sudoers user and give me all permissions.

echo ' username ALL=(ALL)ALL' >>/etc/sudoers

to limit the level of permission on sudo read the sudoers file in /etc