/sbin/mount.cifs //ip_address/windows_sharename/ /home/w/my_folder_on_centos/ -o rw,user=windows_username,password=windows_password,uid=linux_username
I noticed, that without uid=linux_username, the command will mount the share in read-only mode.
i.e. some stuff and junk about Python, Perl, Matlab, Ruby, Mac X, Linux, Solaris, ...
Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts
Thursday, August 18, 2011
CentOS 5: Mount samba share in read-write mode
To mount a windows share on centos with read-write mode, I used the following command as a root
Friday, December 04, 2009
Installing Abaqus 6.9 on CentOS 5.3
In the past post I was installing Abaqus 6.9 on CentOS 5.2. However, the CentOS was upgraded to 5.3 and I needed to also install newer version of Abaqus, i.e. Abaqus 6.9. So, how did it go?
Just like before, the first problem was: Unable to determine Linux Distribution. But this time it was neccessery to put "Red Hat Enterprise Linux Server release 5.0 (Tikanga)" into /etc/redhat-release. To change this file root permissions are required.
After that there were no more problems with the installation or the execution of abaqus 6.9.
After the installation was finished I just original content (i.e. "CentOS release 5.3 (Final)") of /etc/redhat-release back.
Just like before, the first problem was: Unable to determine Linux Distribution. But this time it was neccessery to put "Red Hat Enterprise Linux Server release 5.0 (Tikanga)" into /etc/redhat-release. To change this file root permissions are required.
After that there were no more problems with the installation or the execution of abaqus 6.9.
After the installation was finished I just original content (i.e. "CentOS release 5.3 (Final)") of /etc/redhat-release back.
Labels:
CentOS
Thursday, July 09, 2009
VirtualBox on CentOS 5.3: port forwarding
I have installed VirtualBox 2.2.4 on a CentOS 5.3. As a guest OS I installed Ubuntu, and on that Ubuntu I made a LAMP server. So, what I wanted was to redirect all html requrest on port 80 of CentOS (host) to port 80 of Ubuntu (guest). This is similar problem to the previously described on Windows XP host. The difference is that this time my host was CentOS 5.3, and VirtualBox was running as a normal user, not as a root.
The first thing to do was to make VirtualBox to forward the ports. I did it by executing the following commands, as a normal user under which VirtulBox was running.
Than I wanted to start it in a headless mode
The schematic illustration of what I did is below:
The first thing to do was to make VirtualBox to forward the ports. I did it by executing the following commands, as a normal user under which VirtulBox was running.
VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP
VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80
VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 80
where "ubuntu-server" is the name of Ubuntu guest.Than I wanted to start it in a headless mode
VBoxHeadless -s ubuntu-server
but I was getting the following error:Error: failed to start machine. Error message: NAT#0: configuration error: failed to set up redirection of 80 to 10.0.2.15:80. Probably a conflict with existing services or other rules (VERR_NAT_REDIR_SETUP).
Unknown error creating VM (VERR_NAT_REDIR_SETUP)
This error is due to the fact that in Linux systems only root can bind to ports below 1024, and not a normal user!. There are two possible solutions. First is to run VirtualBox as a root, the second is to redirect port 80 to port 8080 in the CentOS and the make VirtualBox to get connection from port 8080 of CentOS. I choose the second option. Therefore, I did as follows:VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP
VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80
VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 8080
The above makes VirtualBox to redirect trafic from 8080 of CentOS to 80 of guest ubuntu-server. Than as a root I used iptables to redirect port 80 to 8080 in CentOS iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
To check if iptables command was succesfull I used iptables -t nat -L commandiptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
If OK save your iptables settings usingsudo /etc/init.d/iptables save
Hope it will be useful. I also used VirtualBox 2.2, rather then VirtualBox 3.0, but I think the procedure will be similar.The schematic illustration of what I did is below:
Labels:
CentOS,
Linux,
Ubuntu,
VirtualBox
Wednesday, July 08, 2009
Install VirtualBox on CentOS 5
Go to the conclusions if you have no time for BS. If you have time the details of my installation of VirtualBox 2.2.4 on CentOS 5.3 are below.
1. I downloaded VirtuaBox rpm form virtualbox.org. In my case I downloaded VirtualBox-2.2.4_47978_rhel5-1.i386.rpm
2. Installed the rpm as a root
3. So I installed SDL
4. I removed failed installation of VirtualBox
1. I downloaded VirtuaBox rpm form virtualbox.org. In my case I downloaded VirtualBox-2.2.4_47978_rhel5-1.i386.rpm
2. Installed the rpm as a root
su root -c "rpm -ivh VirtualBox-2.2.4_47978_rhel5-1.i386.rpm"
But I got the errorerror: Failed dependencies:
libSDL-1.2.so.0 is needed by VirtualBox-2.2.4_47978_rhel5-1.i386
3. So I installed SDL
su root -c "yum install SDL"
and I tried again su root -c "rpm -ivh VirtualBox-2.2.4_47978_rhel5-1.i386.rpm"
and the installation failed Preparing... ########################################### [100%]
1:VirtualBox ########################################### [100%]
Creating group 'vboxusers'. VM users must be member of that group!
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute
/etc/init.d/vboxdrv setup
as root.
The reason is that kernel-headers and kernel-develop packages were missing, so I installed them su root -c "yum install kernel-headers kernel-devel"
Be sure that the install packages correspond to your kernel version! You can check this as follows: [W@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.18-128.1.16.el5 #1 SMP Tue Jun 30 06:10:28 EDT 2009 i686 i686 i386 GNU/Linux
[W@localhost ~]$ rpm -q kernel-headers kernel-devel
kernel-headers-2.6.18-128.1.16.el5
kernel-devel-2.6.18-128.1.16.el5
4. I removed failed installation of VirtualBox
su root -c "rpm -e VirtualBox-2.2.4_47978_rhel5-1.i386"
and I tried again to install it. Again I got the same error. But this time the reason was that I did not have gcc installed. So I installed it su root -c "yum install gcc"
, removed failed installation of VirtualBox and tried again to install it: [W@localhost ~]$ su root -c "rpm -ivh VirtualBox-2.2.4_47978_rhel5-1.i386.rpm"
Password:
Preparing... ########################################### [100%]
1:VirtualBox ########################################### [100%]
Creating group 'vboxusers'. VM users must be member of that group!
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Success!
This time it worked!!Concussion
First, download VirtualBox from virtualbox.org. Second, install four missing packages (at least I did not have these packages installed, they are on CentOS CDs/DVD, you can use pirut or yum to install them)su root -c "yum install SDL kernel-devel kernel-headers gcc"
Third, install VirtualBox su root -c "rpm -e VirtualBox-2.2.4_47978_rhel5-1.i386"
Fourth, add yourself to the vboxusers group su root -c "/usr/sbin/usermod -a -G vboxusers yourusername"
Finally, start VirtualBox:[W@localhost ~]$ VirtualBox

Labels:
CentOS,
Linux,
VirtualBox
Monday, July 06, 2009
Update of CentOS 5.2 to CentOS 5.3
There was no problems with the update. I just followed the instructions. Most importantly, after the update to CentOS 5.3, applications previously installed in CentOS 5.2 worked (i.e. Ansys 11SP1, Matlab 2008b, Mathematica 7, Abaqus 6.8).
Wednesday, June 17, 2009
CentoOS: problem to install Abacus 6.8
When I was installing Abacus 6.8 on CentOS 5.2 x86_64 I run into three problems. The first one was that installation script did not recognize my Linux distribution (i.e. CentOS 5.2), the second was that that after successful installation, I could not start freshly installed abacus because of missing one library, and the last problem was that the GUI would not start. Below more details on these problems are given, along with my solutions to them.
1. Unable to determine Linux Distribution
When a user (or a root) wants to install Abacus 6.8 on CentOS 5.2, at the beginning of installation process the error appears: "Unable to determine Linux Distribution". In another words, CentOS is not supported and the user should use Red Hat Enterprise or SuSE. The full list of the supported distributions is in the contents of the error and the error itself is shown below:
Checking system requirements for installation. This will
take just a moment...
***ERROR: One or more system tests have failed the minimum installation
requirements. The installation procedure will not continue.
Hit to view the output from this system check.
Checking for GNU Lib C version 2.3.2 or newer.
Pass - Found GNU Lib C Version 2.5.
WARNING: Problem parsing /etc/redhat-release to determine version of Red Hat.
Running system configuration checks for Linux/x86-64.
Please wait until all the needed information has been gathered...
System requirement status is:
Requirement: SuSE 9.3, 10.0, 10.1 or 10.2, SuSE Enterprise Linux 9.0
or 10.0, SuSE Enterprise Desktop 10, Red Hat Enterprise
3.0, 4.0 or 5.0, or Fedora Core 6.0
Products: All Abaqus Products
Status: Fail - Unable to determine Linux Distribution.
Requirement: GNU Lib C 2.3.2 or greater
Products: All Abaqus Products
Status: Pass - Found GNU Lib C 2.5, which was installed with
glibc-2.5-24.rpm.
Not all requirement checks succeeded.
The solution to this problem is quite easy. After going through some installation scripts, I found that, they relay on the file /etc/redhat-release. This file can be found in RHEL and CentOS. Therefore, instalation script checks the contents of this file, and if it does not find something familiar e.g. Red Hat Enterprise Linux AS 5, the error occurs and the installation stops. In CentOS 5.2. the contents of this file is just one line:[W@localhost ~]$ cat /etc/redhat-release
CentOS release 5.2 (Final)
Therefore, what can be done is to change this file temporary, just for the purpose of the installation of Abacus. I just add "Red Hat Enterprise Linux AS 5" as a second line /etc/redhat-release and the installation script should worked.The installation went good, no more problems. The other two problems occurred after successful installation, when I wanted to start Abaqus.
Error while loading shared libraries: libstdc++.so.5
I installed Abaqus in /opt/abaqus68. During the first attempt to start Abaqus CAE or Viewer I got the error that there are was no libstdc++.so.5 library:[W@localhost ~]$ /opt/abaqus68/Commands/abq682 cae
/opt/abaqus68/6.8-2/exec/ABQcaeK.exe: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
Abaqus Error: Abaqus/CAE Kernel exited with an error.
This problem was easily solved, because CentOS 5.2 DVD comes with this library. So, I just installed it using pirut. To be specific I installed the following rpm: compat-ibstdc++-33-3.2.3-61.x86_64
Insufficient system resource available.
After installing the missing library, the finall error was "ValueError: Insufficient system resource available."[W@localhost ~]$ /opt/abaqus68/Commands/abq682 cea
Abaqus License Manager checked out the following license(s):
"cae" version 6.8 from abaqus.some.example.com
<6>.
ValueError: Insufficient system resource available.
Abaqus Error: Abaqus/CAE Kernel exited with an error.
Abaqus Error: Abaqus/Viewer exited with an error
This problem has something to do with X11 server and graphics hardware acceleration. My server does not have 3D graphic card, so no chance for hardware acceleration. The solution was to disable it by starting abaqus with and option -mesa:/opt/abaqus68/Commands/abq682 cae -mesa
or/opt/abaqus68/Commands/abq682 viewer -mesa
Finnaly, after some time spent on installing and starting Abaqus I and other users could use it:
Sunday, June 14, 2009
Mathematica: xset: bad font path element (#23)
I have Mathematica 7.0 installed on a Linux server with CentOS 5.2. I'm using my PC (now Arch Linux) to x forwad (ssh -Y login@server) mathematica from the server to my PC. Unfortunately I was getting error 
This is a common problem and the solution is here. For clarity I write what I did:
xset: bad font path element (#23), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax
After 20-30 seconds I was getting the following window: 
This is a common problem and the solution is here. For clarity I write what I did:
- From Mathematica's CD I unpacked /Unix/Files/Fonts/contents.tar.gz into my home directory in my Arch Linux PC. After unpacking the font path was: /home/W/SystemFiles/Fonts/Type1
- I added this path to my font path:
xset fp+ /home/W/SystemFiles/Fonts/Type1; xset fp rehash
- I chacked if the new path was included:
xset q
- I logged into the serwer using ssh -Y login@server and started mathematica and it worked!
Sunday, May 24, 2009
CentOS 5: Set a background wallpaper for fluxbox.
To set a background wallpaper for fluxbox in CentOS 5.2 the following command can be used:
fbsetbg -f /usr/share/backgrounds/images/c5-center-2048x1536.jpg
or fbsetbg -f /usr/share/backgrounds/images/default.jpg
The above commands in my case was executed in xterm in running fluxbox. The CentOS's wallpapers are in usr/share/backgrounds/.
Labels:
CentOS
Monday, May 04, 2009
Matlab 2008b: Execute matlab from python in CentOS 5.2
I have Matlab 2008b running on CentOS 5.2 server. I wanted to be able to execute Matlab commands from python. After a search I found mlabwrap 1.0.1. I decided to install it. On CentOS 5.2 I have python 2.4.3. I also installed numpy 1.0.4 from epel repository. numpy is required to install mlabwrap. To install mlabwrap I fallowed the instructions. Fortunately, I had no problems with the installation.
Note: the appearance of the windows in the image is from Mac X because I X forward them from CentOS server.

Thursday, April 30, 2009
limits.conf: virtual memory limit
I was setting some limits on CentOS 5.2 with 24GB of RAM. I wanted to set a limit to virtual memory for a process of group of users to be no more than 4GB. Normally, you a user can do this for its own bash session using
ulimit -v 4000000
I wanted to do the same thing but to as a root (i.e. admin of a server) to a group of users. Such limits can normally be set in /etc/security/limits.conf. There are many limits# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
However, I could not find anything for virtual memory, nor I could find any info about this in the Internet. Therefore, I used the try-and-see approach. Finally, I found that item "as" (i.e. address space limit (kb)) does this! Therefore I made a limit to a group @somegroup hard as 4000000
To check it, I logged in to a server using ssh as a user from the "somegroup" and executed[test@w ~]$ ulimit -a | grep virtual
virtual memory (kbytes, -v) 4000000
This is of course a limit per process of a user from this group, and not limit for a user of a group!
Labels:
CentOS
Monday, April 27, 2009
Matlab: mex error: expected expression before '/' token
Few days ago I installed Matlab 2008b on CentOS 5.2, and I wanted to move my programs from Matlab 2007a on Mac X to the Matlab 2008b on CentOS 5.2. There were no problems with that, execpt my mex C files. When I wanted to compile my mex files in the new Matlab I was getting literally hundreds of errors
my_c.c:653: error: expected expression before '/' token
my_c.c:655: error: expected expression before '/' token
my_c.c:686: error: expected expression before '/' token
my_c.c:688: error: expected expression before '/' token
my_c.c:688: error: expected expression before '/' token
The reason was that in my C files I was using "//" for doing comments, rather than "/* */". By default Matlab 2008b uses ansi standard (i.e. -ansi flag in gcc). The -ansi flag represents ISO C90 (equivalent to flag -std=c89) standard. In this standard there are no "//" for comments. Therefore, I could change all comments in my C files, or compile my C files using -std=c99 flag instead of -ansi flag. In c99 one can use "//" for comments. I choose the second option, and therefore I modified my mexopts.sh file.This file contains default options and flags to be used when executing mex command in matlab (i.e. compiling C files). In my case this this was in my home directory, i.e. ~/.matlab/R2008b/mexopts.sh. So I opened this file and edit parts for my computer. I had CentOS5.2 x64 bits, so I edited part #----------------------------------------------------------------------------
;;
glnxa64)
#----------------------------------------------------------------------------
Specifically, I changed CC='gcc'
CFLAGS=" -ansi -D_GNU_SOURCE"
toCC='gcc'
CFLAGS=' -std=c99'
CFLAGS=" $CFLAGS -D_GNU_SOURCE"
With this change I had no more errors regarding "//" comments.Tip
To determine which options in mexopts.sh your mex compiler is using, one can just make an error or typo in some options and check if mex will crash or not.Thursday, April 16, 2009
CentOS: Tabulator completion for sudo in bash
To enable so-called tab-completion for sudo users, it is enough to add
complete -cf sudo
to your local .bashrc file. It also works for Arch linux. En example is below:[w@localhost ~]$ sudo vnc
vncconfig vncpasswd vncserver
Wednesday, April 15, 2009
Gnome: Add menu item
To add a gnome application menu item or so-called "Desktop Entry" the following procedure can be used (I did it in CentOS5.2). Lets assume that we want to add menu item for Octave. First, as a root create file octave.desktop in /usr/share/applications/ with the following contents:
The advantage of this procedure is that menu entry created will be available for every user, not only for root.
[Desktop Entry]
Name=Octave 3
Comment=Octave instead of Matlab
Categories=Application;
Exec=octave
Terminal=true
Type=Application
Icon=octave.png
Encoding=UTF-8
StartupNotify=true
octave.png icon can be created manually. Just find some octave logo imagee, convert it to png of size of 48x48 pixels and place it in folder /usr/share/pixmaps/. Of course it is not necessary, if icon does not exist gnome will not display any icon, only Name.
Thursday, March 26, 2009
Arch linux: very first impression
Usually I don't write any reviews or any opinions on linux distros. However, I have to make an exception. The reason is that I have just install Arch linux! Arch linux is 
a lightweight and flexible Linux® distribution that tries to Keep It Simple.First on virtual box though, just to see what all the fuss is about. What I see is that this distro is quite interesting, it was easy to install. It was easy to set up fluxbox, and some other programs that I need (e.g. python-numpy, python-scipy, matplotlib). Currently I’m using CentOS on my HPC (high performance computing) server, and ubuntu 8.10 on desktop. In few weeks Ubuntu 9.04 released and I strongly think that I may move to Arch on desktop! Not 100% sure now, but I keep testing arch on virtualbox. Definitely, the first impression is positive! If I'll have some further info about this, I will update this post.

Monday, March 16, 2009
LS-DYNA parallel: SMP vs MPP
LS-DYNA, is an part of ANSYS software and it is a general purpose transient dynamic finite element program capable of simulating complex real world problems.
For large models, you can use the shared memory parallel processing (SMP) or the massively parallel processing (MPP) capabilities of ANSYS LS-DYNA to shorten the elapsed time necessary to run an analysis.
The shared memory parallel processing capabilities allow you to distribute model-solving power over multiple processors on the same machine.
The massively parallel processing (MPP) capabilities of ANSYS LS-DYNA allow you to run the LS-DYNA solver over a cluster of machines or use multiple processors on a single machine.
My question is which one is faster and how faster?
To answer to this question, I performed LS-DYNA simulation of an official LS-DYNA example airbag.deploy.k, once with SMP and once with MPP for different number of CPUs. To use LS-DYNA SMP I used the following example command:ls971.e110 pr=aa_r_dy ncpu=%d i=airbag.deploy.k
where pr=aa_r_dy is my license, and %d is the number of CPUs to be used for solving the airbag problem. For LS-DYNA MPP I used:lsdyna110 -dis -np %d pr=aa_r_dy i=.airbag.deploy.k
where %d is the number of CPUs to be used.The above commands were used in a short Python script (it is here) that executes them with different values of %d, calculates execution times, and generates file with the time results. The times obtained were plotted against number of CPUs used:

Conclusions
It can be seen for the graph, that solving LS-DYNA problems using MPP is faster than using SMP. However, the execution time does not reduce linearly with the number of CPUs. One reason may be that airbag.deploy.k is not well suited for solving using large number of CPUs.Tuesday, March 10, 2009
Xen: performance of full virtualization vs. paravirtualization
I wanted to check what is the difference in performance between virtualization and paravirtualization using Xen. Before going any further some basic info about paravirtualization and full virtualization is given.
Under paravirtualization the kernel of the guest operating system is modified specifically to run on the hypervisor [from here], where hypervisor is a program that runs directly on the hardware of the host system in ring 0. The task of the hypervisor is to handle resource and memory allocation for the virtual machines in addition to providing interfaces for higher level administration and monitoring tools [from here]. Full virtualization provides support for unmodified guest operating systems. The term unmodified refers to operating system kernels which have not been altered to run on a hypervisor and therefore still execute privileged operations as though running in ring 0 of the CPU. In this scenario, the hypervisor provides CPU emulation to handle and modify privileged and protected CPU operations made by unmodified guest operating system kernels [from here].
To compare the performance of paravirtualized system with full virtualized syststem I created two virtual machines (two domU's). The first one was full virtualization with CentOS 5.2 x86_64, while the second one was paravirtualization with the same CentOS 5.2 x86_64. CentOS's were installed with identical sets of packages and configurations. The only difference between the two, was that one was installed using full virtualization, while the second was installed using paravirtualization. Both were installed with four virtual CPU's and 1GB of RAM. The host (dom0) was CentOS 5.2 x86_64 with 24 CPUs (4 physical Xeon CPUs, each with 6 cores) and 24GB of RAM. It must be noted the my CPUs support hardware virtualization (Intel VT-x). Hardware virtualization leverages virtualization features built into the latest generations of CPUs from both Intel and AMD [from here]. Therefore, the following title of this post could be better: Xen: performance of hardware virtualization vs. paravirtualization. However, I basically refer to the fact that in paravirtualization the kernel of the guest (i.e. domU) is modified, while in full and hardware virtualizations the kernel of the guest is not modified.
To compare the performance the following benchmarks were used: nbench, bench and primes 0.9. nbench and bench are single-threaded benchmarks, while primes is multi-threaded benchmark. Primes benchmark was executed with four CPUs and option #15 (i.e. find all prime number less than 256,000,000). The tests on one virtual machine were performed while the other was not running.
Some results are presented below. Full results are here (PV) and here (FV). Better results between the two virtualization method were marked using bold font. For complicity, results for dom0 are also given. Dom0 was the same CentOS 5.2 x86_64 as was used in virtual machines. However, there were differences in configuration, installed packages and services. In another words, dom0 was little more loaded than any domU. During the tests on dom0, virtual machines were shutdown. The full results for dom0 are here.
Update 17/03/09: I tested fully virtualized ubuntu-server 8.10 using nbench and got: 19.037,18.017 and 28.756.
* - four CPUs were used.
Update 17/03/09: I tested fully virtualized ubuntu-server 8.10 using primes, and got 113.297 s.
Under paravirtualization the kernel of the guest operating system is modified specifically to run on the hypervisor [from here], where hypervisor is a program that runs directly on the hardware of the host system in ring 0. The task of the hypervisor is to handle resource and memory allocation for the virtual machines in addition to providing interfaces for higher level administration and monitoring tools [from here]. Full virtualization provides support for unmodified guest operating systems. The term unmodified refers to operating system kernels which have not been altered to run on a hypervisor and therefore still execute privileged operations as though running in ring 0 of the CPU. In this scenario, the hypervisor provides CPU emulation to handle and modify privileged and protected CPU operations made by unmodified guest operating system kernels [from here].
To compare the performance of paravirtualized system with full virtualized syststem I created two virtual machines (two domU's). The first one was full virtualization with CentOS 5.2 x86_64, while the second one was paravirtualization with the same CentOS 5.2 x86_64. CentOS's were installed with identical sets of packages and configurations. The only difference between the two, was that one was installed using full virtualization, while the second was installed using paravirtualization. Both were installed with four virtual CPU's and 1GB of RAM. The host (dom0) was CentOS 5.2 x86_64 with 24 CPUs (4 physical Xeon CPUs, each with 6 cores) and 24GB of RAM. It must be noted the my CPUs support hardware virtualization (Intel VT-x). Hardware virtualization leverages virtualization features built into the latest generations of CPUs from both Intel and AMD [from here]. Therefore, the following title of this post could be better: Xen: performance of hardware virtualization vs. paravirtualization. However, I basically refer to the fact that in paravirtualization the kernel of the guest (i.e. domU) is modified, while in full and hardware virtualizations the kernel of the guest is not modified.

Some results are presented below. Full results are here (PV) and here (FV). Better results between the two virtualization method were marked using bold font. For complicity, results for dom0 are also given. Dom0 was the same CentOS 5.2 x86_64 as was used in virtual machines. However, there were differences in configuration, installed packages and services. In another words, dom0 was little more loaded than any domU. During the tests on dom0, virtual machines were shutdown. The full results for dom0 are here.
nbench results
Index (higher is better) | Full virtualization | Paravirtualization | dom0 |
MEMORY INDEX | 18.892 | 18.991 | 21.046 |
INTEGER INDEX | 16.921 | 17.062 | 17.969 |
FLOATING-POINT INDEX | 28.499 | 28.781 | 29.917 |
Update 17/03/09: I tested fully virtualized ubuntu-server 8.10 using nbench and got: 19.037,18.017 and 28.756.
Primes results
Time [s] (lower is better) | Full virtualization | Paravirtualization | dom0* |
Time | 116.423 | 112.432 | 104.67 |
Update 17/03/09: I tested fully virtualized ubuntu-server 8.10 using primes, and got 113.297 s.
bench results
Index (higher is better) | Full virtualization | Paravirtualization | dom0 |
Arithmetic Test (type = double) | 409.6 | 411.6 | 461.3 |
Dhrystone 2 without register variables | 484.4 | 489.8 | 539.2 |
Process Creation Test [lps] | 614.0 | 3176.7 | 2855.6 |
Shell scripts (4 concurrent) [lpm] | 190.6 | 1250.0 | 1261.3 |
Conclusions
Paravirtualization is marginally faster than full virtualization in my case. Therefore, from the results obtained it does not appear that paravirtualization exhibits much greater performance over full virtualization. One reason for this may be the fact that my CPU's support hardware virtualization. However, my tests were not full. Things such as network bandwich, disk operations etc. were not tested. More tests is required.
Xen: Error: Device creation failed for domain
On CentOS 5.2 I had few paravirtualized domU's running. Everything went fine, but one day my Xen could not start any domU. The errors were:
xm create /etc/xen/testPV
Using config file "/etc/xen/testPV ".
Error: Device 0 (vif) could not be connected. Hotplug scripts not working.
The above error was shown about 1-2 min after xm create command was issued. However, when I hit Ctrl+c during this time I got xm create /etc/xen/testPV
Using config file "/etc/xen/testPV".
Error: Device creation failed for domain testPV
I found that these erros were caused by the fact that udevd was not workig. To check if it is working I usedps aux | grep udevd
udevd is (from man) udevd allows the serialization of hotplug(8) events. The events generated by the kernel may arrive in random order in userspace, that makes it necessary to reorder them. udevd takes care of the kernel supplied sequence number and arranges the events for execution in the correct order. Missing sequences delay the execution of the following events until a timeout is reached.So I started it as a root using:
udevd --daemon
Once it was working I could start my domU's with xm create command. So it appears that in my case udevd was not working. Most likely I killed it by accident.
Friday, March 06, 2009
Missing libXm.so.3 in ANSYS 11 SP1 on RHEL4
According to ANSYS Version 11.0 Service Pack 1 - Platform Support Table, ANSYS 11 SP1 for Intel Xeon EM64T/AMD Opteron is fully supported on Red Hat Enterprise Linux 4.0. One would expect that installing and running ANSYS on this OS would be painless. However, although installation along with setting licence went smooth, I had problems starting ANSYS. The error was:
/usr/ansys_inc/v110/ansys/bin/linem64t/ansys.e110: error while loading shared libraries: libXm.so.3: cannot open shared object file: No such file or directory
Therefore, the first thing I did was to check if my RHEL4.5 comes with this library. To do this I did as a root:find / -name "libXm.so.3"
As a result I found this library in /usr/X11R6/lib/. This library belongs to openmotif package, however in my case I had 32bit version of this package. My RHEL4.5 and ANSYS were for x86_64 platform. The only thing I had to do, was to install 64bit version rpm -ivh openmotif-2.2.3-10.1.el4.x86_64.rpm
Openmotif package contains libraries of graphical user interface that is used in ANSYS. This package can be found on RHEL4.5 installation CDs/DVD. Once the package was installed, libXm.so.3 was also located in /usr/X11R6/lib64/. This was enough to start ANSYS.Very similar problems were found when the same ANSYS 11 SP1 was installed on CentOS5.2 on the same machine. So, in my case there was no apparent advantage in using RHEL4.5 over CentOS5.2. It appears that that similar problems occur whether I was using officially supported OS than not supported.
One would expect that when ANSYS claims that something is supported it would work out of the box. Unfortunately, this is not the case. This was not the only problem with ANSYS. I also cannot start CFX launcher. I get en error
Finally, I have to point out that ANSYS Version 11.0 Service Pack 1 - Platform Support Table says RHEL 4.0 not 4.5! So maybe if I was using over 4 years old OS, everything would work out of box.
One would expect that when ANSYS claims that something is supported it would work out of the box. Unfortunately, this is not the case. This was not the only problem with ANSYS. I also cannot start CFX launcher. I get en error
/var/tmp/anslaunch110.chris.12.sh: line 3: cfx5: command not found
The same situation is in CentOS 5.2. However, since I do not need to use CFX I did not spend any time trying to make it work. If someone knows, how to fix it, I would be very grateful. It seems that some paths must be added to PATH environmental variable.Finally, I have to point out that ANSYS Version 11.0 Service Pack 1 - Platform Support Table says RHEL 4.0 not 4.5! So maybe if I was using over 4 years old OS, everything would work out of box.
Tuesday, March 03, 2009
CentOS: ANSYS: error while loading shared libraries: libXm.so.3
After installing ANSYS 11 SP1 on CentoOS 5.2 x86_64 and trying to start some new job I got the error that libXm.so.3 is missing. Ansys does not come with it, so I installed it form CentOS5.2 dvd. To be specific, I installed the following package that contains this library:
openmotif22-2.2.3-18.x86_64.rpm
Just after this I had another error: "cannot restore segment prot after reloc: Permission denied". This is due to SElinux. Therefore, I disabled SElinux in CentOS5.2 using Security Level and Firewall in Gnome System->Administration. No reboot was required.
Thursday, February 26, 2009
CentOS: Add/Remove Software from DVD image
If no internet connection is available on one's server, Add/Remove Software tool (i.e. pirut) hangs! First thing I did (as a root) to make it run was to go to /etc/yum.repos.d/ and rename file CentOS-Base.repo.
mv CentOS-Base.repo CentOS-Base.repo.backup
As a result pirut started and showed all installed packaged. However, no packages available for installation were shown. The reason is that there are no repositories. For that reason I mounted DVD image of my CentOS 5.2 in /media/CentOS. If CentoOS folder does not exist please create it. To mount the DVD I used the following:mount -o loop /home/me/CentOS-5.2-x86_64-bin-DVD.iso /media/CentOS
Then I change enabled=0 to enabled=1in file /etc/yum.repos.d/CentOS-Media.repo. And finally, I could install software from CentOS dvd.
Labels:
CentOS
Subscribe to:
Comments (Atom)