Pages

Unixbhaskar's Blog

Tuesday, January 3, 2012

How to get over Gentoo's X display problem after update

Yep! I could have write the title more specific way,but let it go.So as normal routine I ran a worldsync on my Gentoo and bang! once I reboot the X was not coming up in-spite of having everything in place. What the heck!!!

Then,I realize that update make some enhancement to X and associated things are not getting updated with it.

So, instinctively poking at the log file tell me that "ABI version of so many thing ,related to X driver is mismatching with the server version" and then the obvious thing a little google search reveal that too.Something like this in log file shows:


38.004] (EE) module ABI major version (10) doesn't match the server's version (11)
[ 38.004] (II) UnloadModule: "vesa"
[ 38.004] (II) Unloading vesa
[ 38.005] (EE) Failed to load module "vesa" (module requirement mismatch, 0)
[ 38.005] (II) LoadModule: "fbdev"
[ 38.005] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[ 38.005] (II) Module fbdev: vendor="X.Org Foundation"
[ 38.005] compiled for 1.10.2, module version = 0.4.2
[ 38.005] ABI class: X.Org Video Driver, version 10.0
[ 38.005] (EE) module ABI major version (10) doesn't match the server's version (11)
[ 38.005] (II) UnloadModule: "fbdev"
[ 38.005] (II) Unloading fbdev
[ 38.005] (EE) Failed to load module "fbdev" (module requirement mismatch, 0)
[ 38.005] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,
E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,
Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),
Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),
Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),
Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),
Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server
[ 38.005] (++) using VT number 7

[ 38.038] (EE) No devices detected.
[ 38.038]
Fatal server error:
[ 38.038] no screens found
[ 38.038]
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 38.038] Please also check the log file at "/var/log/Xorg.1.log" for additional information.
[ 38.038]




Now the time to rebuild the X11 drivers ,because I got new X server to match with it.Did it like this :



bhaskar@GentooLinux_15:11:04_Tue Jan 03:~> sudo emerge -1 $(qlist -IC x11-drivers)



That is numeric one to the emerge flag...means oneshot..means not put an entry in world file...

Once it finish I reboot the machine and voila...the X display come back!!

Hope this will help.

Cheers!
Bhaskar

Thursday, December 8, 2011

Using kvm on Arch Linux to install CentOS 6

This is mighty interesting and damn easy thing to do for better way to use and test new releases.I am gonna show you how you can exploit the power of KVM with minimal fuss.So here we go:

I am sitting on Arch Linux and got to bring in the kvm thing into the box..so I went ahead and do this :


bhaskar@ArchLinux_12:24:23_Thu Dec 08:~> sudo pacman -S qemu-kvm
resolving dependencies...
looking for inter-conflicts...

Targets (2): vde2-2.3.1-1 qemu-kvm-0.15.1-1

Total Download Size: 1.96 MB
Total Installed Size: 10.31 MB

Proceed with installation? [Y/n] y
:: Retrieving packages from extra...
vde2-2.3.1-1-i686 177.1K 58.0K/s 00:00:03 [#####################################################################] 100%
qemu-kvm-0.15.1-1-i686 1829.6K 62.8K/s 00:00:29 [#####################################################################] 100%
(2/2) checking package integrity [#####################################################################] 100%
(2/2) checking for file conflicts [#####################################################################] 100%
....
.....



Then I add myself to the kvm group like below:


bhaskar@ArchLinux_12:26:58_Thu Dec 08:~> sudo /usr/sbin/usermod -G kvm -a bhaskar

bhaskar@ArchLinux_12:27:12_Thu Dec 08:~> id bhaskar
uid=1000(bhaskar) gid=1000(bhaskar) groups=1000(bhaskar),92(audio),78(kvm)



Next, I modprobe two kernel module to integrate with the system like below:



bhaskar@ArchLinux_12:27:58_Thu Dec 08:~> sudo /sbin/modprobe kvm-intel

bhaskar@ArchLinux_12:28:10_Thu Dec 08:~> sudo /sbin/modprobe kvm



And the result shows like this :


bhaskar@ArchLinux_12:28:24_Thu Dec 08:~> sudo /bin/lsmod | grep kvm*
kvm_intel 116373 0
kvm 294406 1 kvm_intel



Then,the final step ,oh btw I have the ISO image of CentOS6 already downloaded in my system, so it easy to use...

So I went ahead like this to boot it from that ISO file by kvm:


bhaskar@ArchLinux_12:39:04_Thu Dec 08:~> qemu-kvm -enable-kvm -cdrom /home/bhaskar/Downloads/CentOS-6.0-i386-bin-DVD.iso


And here is how it look like the initial screen:



So ,pretty easy..huh..you can pass hell lot of option to that command line of qemu-kvm to fine tune you instances.

Hope this will help.

Cheers!
Bhaskar

Tuesday, December 6, 2011

How to get over Mutt's saga of "Unknown variables"

I have wrote an article about Mutt here . Now I have changed the system and trying to build it to different system and I am getting this errors:


bhaskar@GentooLinux_15:01:02_Tue Dec 06:~> mutt
Error in /home/bhaskar/.muttrc, line 12: imap_user: unknown variable
Error in /home/bhaskar/.muttrc, line 13: imap_pass: unknown variable
Error in /home/bhaskar/.muttrc, line 45: message_cachedir: unknown variable
Error in /home/bhaskar/.muttrc, line 58: smtp_url: unknown variable
Error in /home/bhaskar/.muttrc, line 59: smtp_pass: unknown variable
Error in /home/bhaskar/.muttrc, line 60: too few arguments



Pretty ordinary!! huh...no so..I was bemused for sometime then discover that when I pull in Mutt on Gentoo it failed to activate those flags and hence causing problem, here is the evidence of lacking those facilities:


bhaskar@GentooLinux_15:22:37_Tue Dec 06:~> mutt -v
Mutt 1.5.21 (2010-09-15, Gentoo 1.5.21-r1)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 3.0.6-gentoo (i686)
ncurses: ncurses 5.9.20110404 (compiled with 5.9)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Aug 2 2011 22:18:59)
Compile options:
-DOMAIN
-DEBUG
+HOMESPOOL -USE_SETGID +USE_DOTLOCK +DL_STANDALONE -USE_FCNTL +USE_FLOCK
-USE_POP -USE_NNTP -USE_IMAP -USE_SMTP
-USE_SSL_OPENSSL -USE_SSL_GNUTLS -USE_SASL -USE_GSS -HAVE_GETADDRINFO
-HAVE_REGCOMP +USE_GNU_REGEX +COMPRESSED
+HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET
+HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP -CRYPT_BACKEND_CLASSIC_SMIME -CRYPT_BACKEND_GPGME
-EXACT_ADDRESS -SUN_ATTACHMENT
+ENABLE_NLS -LOCALES_HACK +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR
+HAVE_ICONV -ICONV_NONTRANS -HAVE_LIBIDN +HAVE_GETSID +USE_HCACHE
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="Maildir"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc/mutt"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to .
To report a bug, please visit http://bugs.mutt.org/.

dgc.subjrx
fg.smarttime
vvv.initials
vvv.quote
vvv.nntp
patch-1.5.20hg.pdmef.progress.vl.2
rr.compressed
patch-1.5.4.lpr.collapse_flagged Lukas P. Ruf


The minus(-) prepended variables are not activated..so I need to activate them,which is causing trouble.

Now I need to reinstall mutt with all those enabled..so here we go :

First I have to set some use flags in /etc/portage/package.use/mutt.use file:


mail-client/mutt imap smtp pop gnutls mbox gpg smime sasl


And off I go to fetch Mutt one more time with those flags enable:


bhaskar@GentooLinux_15:35:56_Tue Dec 06:~> sudo emerge -av mutt

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] mail-client/mutt-1.5.21-r1 USE="berkdb crypt gdbm gnutls* gpg* imap* mbox* nls pop* sasl* smime* smtp* ssl -debug -doc -idn -nntp -qdbm -sidebar -tokyocabinet" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] y



Look at the asterix appended values,which is exactly I did mentioned in the mutt.use file.


Now I can access Mutt without problem :)

Hope this will help.

Cheers!
Bhaskar

Thursday, October 27, 2011

How to update/upgrade Slackware packages from command line

Yep that is the case.Basically you need to follow just two steps to do that. I am going to show you that.I am doing it on Slackware 13.37 version.But the basic remain the same.So here we go:

First and foremost update the existing one; if any pending issue are there ,then it will get resolve.



root@Slackware:~# slackpkg update


It will pop up a TUI and ask for package updation,need to select and press ok.Once that operation done.Go to the next step by doing so..


root@Slackware:~# slackpkg upgrade patches


At the end of this operation it will ask you like this :


Searching for NEW configuration files

Some packages had new configuration files installed.
You have four choices:

(K)eep the old files and consider .new files later

(O)verwrite all old files with the new ones. The
old files will be stored with the suffix .orig

(R)emove all .new files

(P)rompt K, O, R selection for every single file

What do you want (K/O/R/P)?



Now it's your call to take,whether you want to do it by hand or the package manager do it for you. I had little to do this specific upgrade so I went for interactive way; like this :


Select what you want file-by-file

/etc/uniconf.conf.new - (K)eep
(O)verwrite
(R)emove
(D)iff
(M)erge
o

/etc/httpd/httpd.conf.new - (K)eep
(O)verwrite
(R)emove
(D)iff
(M)erge
0 -------------------> my selection

/etc/gconf/2/path.new - (K)eep
(O)verwrite
(R)emove
(D)iff
(M)erge
o -----------------------> my selection

/etc/gconf/2/evoldap.conf.new - (K)eep
(O)verwrite
(R)emove
(D)iff
(M)erge
o ------------------> my selection



But for huge upgrade, you should fall back to package manager to do the job for you.Or you are curious(you should be!) then do it by hand, and it will take some amount of time.

Hope this will help.

Cheers!
Bhaskar

Monday, October 17, 2011

Running google-chrome browser on Scientific Linux

You feel the title looks ordinary..yes it is and it;s my lack of observation caused this hindrance.


The problem: As far as I am concerned SL not come with google-repository with it. So I went ahead and installed it like most of the RH system do.Yep, SL is a clone of RH system.

The repo looks like below:


bhaskar@Scientific-Linux_11:22:47_Mon Oct 17:~> sudo cat /etc/yum.repos.d/google.repo
[sudo] password for bhaskar:
[google]
name=Google - i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=0
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub


and


bhaskar@Scientific-Linux_12:06:07_Mon Oct 17:~> sudo cat /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1


Then as usual do the following to install it:

bhaskar@Scientific-Linux_12:06:33_Mon Oct 17:~> sudo yum install google-chrome-stable
Loaded plugins: refresh-packagekit
Setting up Install Process
Package google-chrome-stable-14.0.835.202-103287.i386 already installed and latest version
Nothing to do


So what's the big deal???

If I clicked my google-chrome icon on panel and menu it won't respond!!! irk..So the as usual get into the terminal and paved into the google-chrome dir..and try to fire from the terminal gave me some library not recognizing error..which I resolve by this:


sudo yum install zlib-devel jzlib



Now ,still it's not opening up!! why? After bit of search(and my lack of interest to digg it in the system,which is bad) reveal that in this thread that it is a SELinux ,which prohibiting it from running. You can find the thread here: http://code.google.com/p/chromium/issues/detail?id=87704

Okay, then the obvious next step it correct the SELinux tag for google-sandbox,as mentioned in the thread...


bhaskar@Scientific-Linux_12:17:22_Mon Oct 17:~> sudo chcon -t usr_t /opt/google/chrome/chrome-sandbox


Voila! it is working fine now..what a real laziness can do..very bad of me ahh


Hope this will help.

Cheers!
Bhaskar

Saturday, August 20, 2011

How to make USB modem work on Arch Linux

I think this topic is an uncanny one..YMMV. Anyway I have done it hundred times before and thought to share it with people.Plug in the USB modem and think it just work in GNU/Linux laptop is not the case(tell me the exception if you have come across one!!).

It basically require few thing to be checked out in the box,which are mandatory for the USB modem to work..which are:

1) You need to figure out whether usbserial driver is loaded into the system or not.But how do you detect that?(kidding!! I know all of you know that). Still give away the steps to do that:

A) at the terminal,please type the following:

sudo /sbin/lsmod |grep usbserial


and you should get a response like below:


bhaskar@bhaskar-laptop_09:47:44_Sat Aug 20:~> sudo /bin/lsmod | grep usbserial
usbserial 26639 4
usbcore 119644 9 uas,ums_realtek,usb_storage,uvcvideo,btusb,usbserial,xhci_hcd,ehci_hcd



Now if you don't get a response from that command,that means kernel haven't load the driver to detect the USB thing.So you need to do the following:


sudo /sbin/modprobe usbserial


It basically get that driver initialize into the system to work with it.So the story is not end here..read on..

Step number 2:

It is essentially driven by the UDEV thing..so until you make the UDEV aware of it..it will still hinder you from using it.

So how do you do that?

Now you need to go to the directory called /etc/udev/rules.d..it should be there already and you need to add a udev rule file to in this dir like below:

ACTION!="add", GOTO="ZTE_End"

# Is this the ZeroCD device?
SUBSYSTEM=="usb", SYSFS{idProduct}=="2000",
SYSFS{idVendor}=="191g, GOTO="ZTE_ZeroCD"

# Is this the actual modem?
SUBSYSTEM=="usb", SYSFS{idProduct}=="0001",
SYSFS{idVendor}=="191g", GOTO="ZTE_Modem"

LABEL="ZTE_ZeroCD"
# This is the ZeroCD part of the card, remove
# the usb_storage kernel module so
# it does not get treated like a storage device
#RUN+="/sbin/rmmod usb_storage"

LABEL="ZTE_Modem"
# This is the Modem part of the card, let's
# load usbserial with the correct vendor
# and product ID's so we get our usb serial devices
RUN+="/sbin/modprobe usbserial vendor=0x191g product=0xffff",
# Make users belonging to the dialout group
# able to use the usb serial devices.
MODE="660", GROUP="dialout"

LABEL="ZTE_End"


I think the file is almost self explain itself.Now you need to restart the network one more time and put in your USB modem into the usb socket.

Then fire the command at the terminal..I am assuming you have wvdial installed in the system..



sudo wvdial providername

The USBmodem should able to ring back to the ISP; that you have already configured and provide you dynamic ip and dns names..voila!!!

You are connected to the internet through the wireless modem on GNU/Linux.To automate the thing in my laptop I have wrote a very very ordinary and mundane script to invoke from command line to get connected to the internet.The script look like below:


#!/bin/bash

if [[ "$UID" = "0" ]]

then

echo " You have the super power to invoke this sript"
else
echo "Sorry, you don't have the power to run this script"
fi



echo
echo
echo " Let's check whether the usb modem is connected to system or not"
echo
echo

/usr/sbin/lsusb | gawk -F: ' { print $2"===>"$3 }'

echo
echo

echo "probing the usb modem...loading driver too....."

/sbin/modprobe usbserial vendor=0x191g product=0xffff

echo
echo

echo "Connecting to ISP...."
echo
echo

/usr/bin/wvdial ProvidernameISP &>/var/log/wvdial&

echo
echo

sleep 5

echo "PID of of the WvDial..."

ps -ef | grep wvdial

echo
echo

sleep 3
echo
echo
echo "Checking the connection...."

/bin/ping -c 3 google.com

echo
echo

echo " Looking for live stat....."
echo
echo

/usr/bin/vnstat -i ppp0 -l



O yeah, I have written some information about vnstat in some other blog.It is a nice utility to measure net bandwidth.

Hope this will help.

Cheers!
Bhaskar

Monday, July 4, 2011

Running Funtoo,SUSE and Slackware through OpenVZ on Fedora 15

In this article I will show you how to run different distros within virtual container.Actually the problem is my machine processor doesn't support virtualization..irk!!! so apart from running different GNU/Linux distros in different physical partitions from several years, now the the time has come to run it seperate space within same OS.

So here we go...first thing first..we need a technology to enable that..and that technology is called OpenVZ . Right? Now I have recently stumble over an article published here and followed those instruction to make it possible for me.

I am running this experiment on Fedora 15 .

Step 1;

Get OpenVZ repo into your machine:

bhaskar@bhaskar-laptop_12:55:46_Mon Jul 04:/etc/yum.repos.d> sudo wget http://download.openvz.org/openvz.repo
[sudo] password for bhaskar:
--2011-07-04 12:56:05-- http://download.openvz.org/openvz.repo
Resolving download.openvz.org... 64.131.90.11
Connecting to download.openvz.org|64.131.90.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3841 (3.8K) [text/plain]
Saving to: “openvz.repo”

100%[===================================================================================================================>] 3,841 --.-K/s in 0.007s

2011-07-04 12:56:21 (503 KB/s) - “openvz.repo” saved [3841/3841]

Step 2:

Get the key for it:
bhaskar@bhaskar-laptop_12:56:21_Mon Jul 04:/etc/yum.repos.d> sudo rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

Step 3:

Search for the specific kernel related to OpenVZ:

bhaskar@bhaskar-laptop_13:01:59_Mon Jul 04:/etc/yum.repos.d> sudo yum search vzkernel
Loaded plugins: langpacks, presto, refresh-packagekit
google | 951 B 00:00
google-chrome | 951 B 00:00
http://mirror.switch.ch/ftp/mirror/rpmfusion/free/fedora/development/source/SRPMS/repodata/repomd.xml: [Errno 14] curl#6 - "Couldn't resolve host"
Trying other mirror.
rpmfusion-free-rawhide-source | 2.7 kB 00:00
rpmfusion-free-rawhide-source/primary_db | 79 kB 00:04
rpmfusion-free-updates | 2.7 kB 00:00
updates/metalink | 7.4 kB 00:00
updates | 4.7 kB 00:00
updates/primary_db | 2.1 MB 00:20
openvz-kernel-rhel6 12/12
updates/pkgtags | 31 kB 00:00
=================================================================== N/S Matched: vzkernel ===================================================================
vzkernel.i686 : The Linux kernel
vzkernel-debug.i686 : The Linux kernel compiled with extra debugging enabled
vzkernel-debug-devel.i686 : Development package for building kernel modules to match the debug kernel
vzkernel-devel.i686 : Development package for building kernel modules to match the kernel
vzkernel-firmware.noarch : Firmware files used by the Linux kernel
vzkernel-headers.i686 : Header files for the Linux kernel for use by glibc

Name and summary matches only, use "search all" for everything.

Step 4:

Install the Kernel:

bhaskar@bhaskar-laptop_13:04:24_Mon Jul 04:/etc/yum.repos.d> sudo yum install vzkernel.i686
[sudo] password for bhaskar:
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vzkernel.i686 0:2.6.32-042stab018.1 will be installed
--> Processing Dependency: virtual-vzkernel-install >= 2.0.0 for package: vzkernel-2.6.32-042stab018.1.i686
--> Running transaction check
---> Package vzctl.i386 0:3.0.28.3-1 will be installed
--> Processing Dependency: vzctl-lib = 3.0.28.3-1 for package: vzctl-3.0.28.3-1.i386
--> Processing Dependency: vzquota >= 2.7.0-4 for package: vzctl-3.0.28.3-1.i386
--> Processing Dependency: libvzctl-0.0.3.so for package: vzctl-3.0.28.3-1.i386
--> Running transaction check
---> Package vzctl-lib.i386 0:3.0.28.3-1 will be installed
---> Package vzquota.i386 0:3.0.12-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
vzkernel i686 2.6.32-042stab018.1 openvz-kernel-rhel6 23 M
Installing for dependencies:
vzctl i386 3.0.28.3-1 openvz-utils 162 k
vzctl-lib i386 3.0.28.3-1 openvz-utils 186 k
vzquota i386 3.0.12-1 openvz-utils 82 k

Transaction Summary
=============================================================================================================================================================
Install 4 Package(s)

Total download size: 23 M
Installed size: 83 M
Is this ok [y/N]:
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 23 M
(1/4): vzctl-3.0.28.3-1.i386.rpm | 162 kB 00:01
(2/4): vzctl-lib-3.0.28.3-1.i386.rpm | 186 kB 00:01
(3/4): vzkernel-2.6.32-042stab018.1.i686.rpm | 23 MB 00:58
(4/4): vzquota-3.0.12-1.i386.rpm | 82 kB 00:01
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 367 kB/s | 23 MB 01:05
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : vzctl-lib-3.0.28.3-1.i386 1/4
Installing : vzquota-3.0.12-1.i386 2/4
Installing : vzctl-3.0.28.3-1.i386 3/4
Installing : vzkernel-2.6.32-042stab018.1.i686 4/4

Installed:
vzkernel.i686 0:2.6.32-042stab018.1

Dependency Installed:
vzctl.i386 0:3.0.28.3-1 vzctl-lib.i386 0:3.0.28.3-1 vzquota.i386 0:3.0.12-1

Complete!

Step 6:

The Grub entry:

title OpenVZ-2.6.32-042stab018.1
root (hd0,5)
kernel /vmlinuz-2.6.32-042stab018.1 ro root=UUID=a2298586-fab5-42a5-a84e-276f9565fb37 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
initrd /initramfs-2.6.32-042stab018.1.img

Step 7:

Installing some openvz tools:

bhaskar@bhaskar-laptop_13:44:13_Mon Jul 04:~> sudo yum install vzctl vzquota
[sudo] password for bhaskar:
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Package vzctl-3.0.28.3-1.i386 already installed and latest version
Package vzquota-3.0.12-1.i386 already installed and latest version
Nothing to do

It is saying so because I have already installed those.

Step 8:

Need to change some kernel parameter:

bhaskar@bhaskar-laptop_13:47:37_Mon Jul 04:~> sudo sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.default.forwarding = 1


Step 9:

Change some variable in vz.conf

vi /etc/vz/vz.conf

and put in

NEIGHBOUR_DEVS=all


Step 10:

Here is the file , where you can disable selinux

selinux disable
/etc/sysconfig/selinux

Step 11:

I am putting different ostemplate I have downloaded from here

And here it looks like :

cd /vz/template/cache/

the place to put different os template

I putting there funtoo,suse,slackware there

bhaskar@bhaskar-laptop_13:52:31_Mon Jul 04:/lvm> sudo mv -v suse-11.4-x86.tar.gz /vz/template/cache/
`suse-11.4-x86.tar.gz' -> `/vz/template/cache/suse-11.4-x86.tar.gz'
removed `suse-11.4-x86.tar.gz'

bhaskar@bhaskar-laptop_13:53:06_Mon Jul 04:/lvm> sudo mv -v slackware-13.37-i486-minimal.tar.gz /vz/template/cache/
`slackware-13.37-i486-minimal.tar.gz' -> `/vz/template/cache/slackware-13.37-i486-minimal.tar.gz'
removed `slackware-13.37-i486-minimal.tar.gz'

bhaskar@bhaskar-laptop_13:53:30_Mon Jul 04:/lvm> sudo mv -v funtoo-openvz-i686-funtoo-current-2011-05-26.tar.xz /vz/template/c
`funtoo-openvz-i686-funtoo-current-2011-05-26.tar.xz' -> `/vz/template/cache/funtoo-openvz-i686-funtoo-current-2011-05-26.tar.xz'
removed `funtoo-openvz-i686-funtoo-current-2011-05-26.tar.xz'

DO NOT UNTAR those files ever.


Step 12:


VPS implementation for SUSE:

bhaskar@bhaskar-laptop_14:05:59_Mon Jul 04:~> sudo vzctl create 101 --ostemplate suse-11.4-x86 --config basic
[sudo] password for bhaskar:
Creating container private area (suse-11.4-x86)
Performing postcreate actions
Saved parameters for CT 101
Container private area was created

Step 13:

Run at boot

bhaskar@bhaskar-laptop_14:08:54_Mon Jul 04:~> sudo vzctl set 101 --onboot yes --save
Saved parameters for CT 101


Step 14:

fix a hostname

bhaskar@bhaskar-laptop_14:10:01_Mon Jul 04:~> sudo vzctl set 101 --hostname SUSE --save
Saved parameters for CT 101

Step 15:

saving ip address

bhaskar@bhaskar-laptop_14:11:57_Mon Jul 04:~> sudo vzctl set 101 --ipadd 127.0.0.2 --save
Saved parameters for CT 101


Step 16:

save some socks

bhaskar@bhaskar-laptop_14:13:32_Mon Jul 04:~> sudo vzctl set 101 --numothersock 120 --save
Saved parameters for CT 101

Step 17:

Save Nameserver

vzctl set 101 --nameserver 8.8.8.8 --nameserver 8.8.4.4 --nameserver 145.253.2.75 --save

Step 18:
vz start and set root password

bhaskar@bhaskar-laptop_14:15:26_Mon Jul 04:~> sudo vzctl start 101
Starting container ...
Container is mounted
Adding IP address(es): 127.0.0.2 192.168.2.167
Setting CPU units: 1000
Set hostname: SUSE
File resolv.conf was modified
Container start in progress...
bhaskar@bhaskar-laptop_14:16:19_Mon Jul 04:~> sudo vzctl exec 101 passwd
New Password:
Bad password: too short
Reenter New Password: suse
Changing password for root.
Password changed.


Step 19:

Enter into one the vz..ie. suse

bhaskar@bhaskar-laptop_14:18:00_Mon Jul 04:~> sudo vzctl enter 101
entered into CT 101
SUSE:/ #


Step 20:
Slackware snapshot

bhaskar@bhaskar-laptop_14:31:54_Mon Jul 04:~> sudo vzctl enter 102
entered into CT 102
root@Slackware13:/# uname -a
Linux Slackware13 2.6.32-042stab018.1 #1 SMP Fri Jun 10 20:04:40 MSD 2011 i686 Intel(R) Core(TM)2 Duo CPU T5450 @ 1.66GHz GenuineIntel GNU/Linux
root@Slackware13:/# ls
bin/ boot/ dev/ etc/ fastboot home/ lib/ media/ mnt/ opt/ proc/ root/ sbin/ srv/ sys/ tmp/ usr/ var/

Step 21:

Inside Funtoo!!

bhaskar@bhaskar-laptop_14:41:38_Mon Jul 04:~> sudo vzctl start 103
Starting container ...
Container is mounted
Adding IP address(es): 192.168.2.118
Setting CPU units: 1000
Set hostname: Funtoo
File resolv.conf was modified
Container start in progress...
bhaskar@bhaskar-laptop_14:41:52_Mon Jul 04:~> sudo vzctl enter 103
entered into CT 103
Funtoo / # ls
bin boot dev etc fastboot home lib libexec mnt opt proc root sbin sys tmp usr var


Step 22:

Here is the vz list:

bhaskar@bhaskar-laptop_14:42:49_Mon Jul 04:~> sudo vzlist -a
CTID NPROC STATUS IP_ADDR HOSTNAME
101 16 running 192.168.2.167 SUSE
102 4 running 192.168.2.117 Slackware13
103 2 running 192.168.2.118 Funtoo


Hope this will help.

Cheers!
Bhaskar