Tag Archives: VMWare

Setup a 3 Node Lustre Filesystem

Introduction

Lustre is a filesystem often used by clusters because many computers can mount the filesystem simultaneously.

This is a small log/instruction for how to setup Lustre in 3 virtualized machines (one metadata server, one object storage server and one client).

Basic components:

VMWare Workstation
3 x CentOS 6.3 VMs.
Latest Lustre from Whamcloud

To use Lustre your kernel needs to support it. There’s a special one for server and one for the client. Some packages are needed on both.

Besides lustre you’ll need an updated version of e2fsprogs as well (because the version that comes from RHEL6.3 does not support large partitions).

Starting with the MDS. When the basic OS setup is done will make a copy of that to use for OSS and Client.

Setup basic services.

Install an MDS

This will run the MDT – the metadata target.

2GB RAM, 10GB disk, bridged networking, 500GB for /boot, rest for / (watch out, it may create a really large swap). Minimal install. Setup OS networking (static ip for servers, start on boot, open port 988 in firewall, possibly some for outgoing if you decide to restrain that too), run yum update and setup ntp. Download latest lustre and e2fsprogs to /root/lustre-client, lustre-server and e2fsprogs appropriately (x86_64). Lustre also does not support selinux, so disable that (works fine with it in enforcing until time to create mds/mdt, also fine with permissive until it’s time to mount).
Put all hostnames into /etc/hosts.
Poweroff and make two full clones.
Set hostname.

Install an OSS

This will contain the OST (object storage target). This is where the data will be stored.

Networking may not work (maybe device name changed to eth1 or eth2).
You may want to change this afterwards to get the interface back to be called (eth0). A blog post about doing that.

Install a client

This will access and use the filesystem.

Clone of the OSS before installing any lustre services or kernels.

Install Lustre

Before you do this it may be wise to take a snapshot of each server. In case you screw the VM up you can then go back :)

Starting with the MDS.

Installing e2fsprogs, kernel and lustre-modules.

Skipping debuginfo and devel packages, installing all the rest.

yum localinstall \ 
kernel-2.6.32-220.4.2.el6_lustre.x86_64.rpm kernel-firmware-2.6.32-220.4.2.el6_lustre.x86_64.rpm \
kernel-headers-2.6.32-220.4.2.el6_lustre.x86_64.rpm \
lustre-2.2.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm \ 
lustre-ldiskfs-3.3.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm \
lustre-modules-2.2.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm

The above was not the order they were installed. Yum changed the order so that for example kernel-headers was last.

yum localinstall e2fsprogs-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-debuginfo-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-devel-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-libs-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-static-1.42.3.wc3-7.el6.x86_64.rpm \
libcom_err-1.42.3.wc3-7.el6.x86_64.rpm \
libcom_err-devel-1.42.3.wc3-7.el6.x86_64.rpm \
libss-1.42.3.wc3-7.el6.x86_64.rpm \
libss-devel-1.42.3.wc3-7.el6.x86_64.rpm

After boot, confirm that you have lustre kernel installed by typing:

uname -av

and

mkfs.lustre --help

to see if you have that and

rpm -qa 'e2fs*'

to see if that was installed properly too.

By the way, you probably want to run this to exclude automatic yum kernel updates:

echo "exclude=kernel*" >> /etc/yum.conf

After install and reboot into new kernel it’s time to modprobe lustre, start creating MDT, OST and then mount things!
But hold on to your horses, first we ned to install the client :)

 

And then the Client

Install the e2fsprogs*

We cannot just install the lustre-client packages, because we run a different kernel than the ones that whamcloud have compiled the lustre-client against.

We can either back-pedal and install an older kernel. Or we can build (from source / SRPMS) a lustre-client that works on a kernel of our choosing. The later option seems like a better way, because we can then upgrade the kernel if we want to.

 

Build custom linux-client rpms

Because of a bug it appears that some ext4 source packages are needed – while they are not. You need to add some parameters to ./configure. This will be the topic of a future post.

The above rpmbuild should create rpms for the running kernel. If you want to create rpms for a non-running kernel you are supposed to be able to run.

Configure Lustre

Whamcloud have good instructions. Don’t be afraid to check out their wiki or use google.

/var/log/messages is the place to look for more detailed errors.

On the MDS

Because we do not have infiniband you want to change the parameters slightly for lnet to include tcp(eth0). These changes are not reflected until reboot (quite possibly something else) – but just editing a file under /etc/modprobe.d/ called for example lustre.conf is not enough.

Added a 5GB disk to the mds.

fdisk -cu /dev/sdb; n, p, 1, (first-last)

modprobe lustre lnet

mkfs.lustre –mdt –mgs

mount

On the OSS

Also add the parameters into modprobe.

mkfs.lustre –ost

mount

On the client

Add things into modprobe.

mount!

Write something.

Then hit: lfs df -h

To see usage!

 

Get it all working on boot

You want to start the MDS, then the OSS and last the client.
But while it’s running you can restart any node and eventually it will start working again.

Fstab on the client:
ip@tcp:/fsname /mnt lustre defaults,_netdev 0 0

Fstab on the OSS and MDS:
/dev/sdb1 /mnt/MDS lustre defaults,_netdev 0 0

While it’s running you can restart any node and eventually it will start working again.

owncloud in a box!

owncloud

http://susestudio.com/a/TadMax/owncloud-in-a-box

Based on opensuse 12.1, I tested this out in vmware workstation by downloading the vm version (has a .vmdk file) inside the .tar inside the .tar.gz.

“Run the appliance, go to http://[yourservername]/owncloud and login as admin with the password owncloud42. Change the password in the admin interface and use the URL, which is shown there to access ownCloud via WebDAV.”

files, music, bookmarks, calendar, e-mail client, ldap and unix pam integration.

All in all, it looks like it could be quite cool. And it appears to be updated quite often too with a quite active community. But this takes a bit of commitment. First you want to move your existing stuff into this one (so you want to have backups of it etc) and you want to host it somewhere reliable (in case you access it through your phone etc). But I can see the potential, is quite nice to not have to depend on google or your other_random_”cloud”_vendor for these kind of services.

OpenIndiana + PostgreSQL + dCache

This is a test for installing openindiana and set up a working dCache test-vm.

dCache is a storage element of the Grid (scientific computing).

OI == OpenIndiana. Kind of like opensolaris with an Illumos kernel, not the sun/oracle kernel.

With http://www.guldmyr.com/blog/esxi-vmware-workstation/ as a base for how to set up ip settings etc in OI.

oi-dev-151a-text-x86.iso installed

pkg install package/pkg

pkg update

java -version

mkdir /var/postgres

useradd postgres

groupadd postgres

chown postgres:postgres /var/postgres

chmod 755 /var/postgres

The pkg update makes it into 151a2

If you do not create the ones above the install of service/postgres will fail and create a new BE.

pkg install pkg:/database/postgres-84
pkg install pkg:/service/database/postgres-84

vi /etc/passwd

change postgres to 90:90 and homedir to /export/home/postgres

mkdir /export/home/postgres

chown postgres.postgres /export/home/postgres
root@oi:~# vi /export/home/postgres/.profile
PATH=/usr/postgres/8.4/bin:${PATH}
PGDATA=/var/postgres/8.4/data
export PATH PGDATA

you probably also want to add these to the root user’s path

svcadm enable postgresql-84:32_bit

root@oi:/var/log# svcs -a|grep postg
disabled       17:29:37 svc:/application/database/postgresql_84:default_64bit
online         17:31:35 svc:/application/database/postgresql_84:default_32bit

su - postgres

psql

\l

I initially did this in an ESXi VM in VMWare Workstation, but that keept freezing so I went over to a ‘real vm’ instead. The VM is more responsive.

dCache stuff

wget it from www.dcache.org

pkgadd -d dcache-server-1.9.12-16.pkg

follow http://www.dcache.org/manuals/Book-1.9.12/start/in-install.shtml for the instructions of which postgresql-scripts and users and stuff to create

It’s however not enough :

root@oi:~# /opt/d-cache/bin/dcache start
/opt/d-cache/bin/dcache[127]: local: not found [No such file or directory]
/opt/d-cache/bin/dcache[128]: local: not found [No such file or directory]
/opt/d-cache/bin/dcache[129]: local: not found [No such file or directory]
/opt/d-cache/bin/dcache[130]: local: not found [No such file or directory]
/opt/d-cache/bin/dcache[131]: local: not found [No such file or directory]
/opt/d-cache/bin/dcache[132]: local: not found [No such file or directory]
/opt/d-cache/bin/dcache[317]: .[162]: local: not found [No such file or directory]

so, edit /opt/d-cache/bin/dcache and remove the if in the beginning that will make it use /usr/xpg4/bin/sh – so that it uses /bin/bash instead.

Like this:

if [ "$1" = "%" ]; then
    shift
elif [ "`uname`" = "SunOS" ]; then
    if [ -x /bin/bash ]; then
        exec /bin/bash $0 % "$@"
    else
        echo "Cannot find POSIX compliant shell. This script will"
        echo "probably break, but we attempt to execute it anyway."
    fi
fi

after I changed this, I noticed in the console that it said:

rpcbind: non-local attempt to set

bad?

anyway, then start dCache

root@oi:/opt/d-cache/bin# /opt/d-cache/bin/dcache start
Starting dCacheDomain done

in /var/log/dCacheDomain.log you’ll find why it’s not working:

touch /etc/exports

and it appears to be stable, except for some errors about (NFSv3-oi), however, we disregard those for now, we just want to get it running!

vi /opt/d-cache/etc/dcache.conf
dcache.layout=single
mkdir /pool1

and

vi /opt/d-cache/etc/layouts/single.conf

uncomment the pool1 section, set a maxDiskSize=2G to specify max disk space allowed.
Specifics are in the installation part on dcache.org in the book.

Then point your webbrowser to – see any blue buttons?! yay, it’s up!

Next step is to try it out, this might prove a little bit more difficult (to find dcap/root/srm client for opensolaris/oi).

PostgreSQL problem

so maybe next time you restart the vm it gives some errors and puts the postgresql-server in maintenance mode. Look in /var/adm/messages for some tips, it should point you to

svcs -xv svc:/application/database/postgresql_84:default_32bit

/var/svc/log/application-database-postgresql_84\:default_32bit.log

which will tell you more about what’s going on and how to fix it

svcadm restart
svcadm clear

Use dCache with webdav

We’ll start with trying to use Webdav (doesn’t require anything fancy on the client side, except maybe a browser plugin for uploading).

go to the layout file and uncomment the webdav part, add

webdavAnonymousAccess=FULL
webdavRootPath=/data/world-writable

The script /opt/d-cache/bin/chimera-cli.sh sadly assumes that you need bash or a special version of bash somehow.
So running

bash /opt/d-cache/bin/chimera-cli.sh mkdir /data

works, but

/opt/d-cache/bin/chimera-cli.sh mkdir /data

does not.

See http://www.dcache.org/manuals/Book-1.9.12/start/intouch-client.shtml for the rest.

If you keep the webdav in the same domain you’ll need to restart the whole dcache.

In Windows 7 you can then mount a new network folder and click “Connect to a web site that you can use to store your documents and pictures” and in there type:

Now you get another folder in your computer where you can create folders. These will also show up if you surf to , sadly however, you cannot write files. gridpp.ac.uk says it’s because pool is full. But it’s 2048MiB and all free?

https://twiki.grid.iu.edu/bin/view/Storage/MeetingMinutes2009Sep02

suggests minimum pool size might be 4G, changed pool maxdiskspace to 8G.

tada, now the copy starts, or the file creation starts, but I cannot actually write anything to it. So if I create a .txt file, I can give it a name and save it, unless I try to write anything inside it!

some errors to accompany this:

 (WebDAV-oi) [door:WebDAV-oi@dCacheDomain:13295xxx] Your resource factory returned a resource with a different name to that requested!!! Requested: null returned: world-writable - resource factory: class org.dcache.webdav.DcacheResourceFactory
 (WebDAV-oi) [door:WebDAV-oi@dCacheDomain:13295xxx] resource is being locked with a null user. This won't really be locked at all...
 (WebDAV-oi) [door:WebDAV-oi@dCacheDomain:13295xxx] resource is being locked with a null user. This won't really be locked at all...
 (WebDAV-oi) [door:WebDAV-oi@dCacheDomain:13295xxx] Your resource factory returned a resource with a different name to that requested!!! Requested: null returned: world-writable - resource factory: class org.dcache.webdav.DcacheResourceFactory
 (pool1) [00002CBCC971ABC14BDC9E496A0AEAA31FC3] A task was added to queue 'store', however the queue is not configured to execute any tasks.

trying dccp

[root] # cd /etc/yum.repos.d/
[root] # wget http://grid-deployment.web.cern.ch/grid-deployment/glite/repos/3.2/glite-UI.repo
or 
[root] # yum install dcap dccp -d 63 -H /bin/bash dcap://ip.to.server/data/world-writable/2nd/4 creates another empty file, while it adds an entry to the 'store' queue and then not so much happens. stuck on this: Sending control message: 2 0 client open "dcap://IP.to.server/data/world-writable/2nd/4" w -mode=0755 -truncate sl1 40619 -timeout=-1 -onerror=default  -alloc-size=938672  -uid=0 (len=153) 

NFSv41

uncomment the nfsv3 and add nfsv41
then on a system you should be able to ‘apt-get install nfs-common’; modprobe nfs; mkdir /nfsv4 mount -t nfs4 ip.to.server:/ /nfsv4′. But for me this stops working with an “cp: closing `./bash’: Input/output error”. Possibly because I could not specify -o minorversion=1 on this ubuntu install (3.0.0-16).

 

NFSv41 with dCacheToGo

Download dCache2Go from here:

To convert it into VMware format:

VBoxManage clonehd source.vdi target.vmdk --format VMDK

Then create new vm and set the new vmdk file as the disk.

When this VM is up (and the dCache server of course), hit:

mount -t nfs4 -o minorversion ip.to.dcache.host:/ /mnt

then

cd /mnt/data/world-writable
mkdir another
cd another
cp /bin/bash .
cp bash /tmp/bash
diff /tmp/bash /bin/bash

SCORE! We have a working dCache setup in a VM running openindiana!

Windows 8 Consumer Preview in VMWare Workstation

Checking out the new Windows 8 Consumer preview!
Installing in a VM on a host with Windows 7 and Intel Core i7.
Downloading the x64 English version from here: http://windows.microsoft.com/en-US/windows-8/iso
“To snap apps, you need a screen resolution of at least 1366 x 768” so I guess I better increase the resolution! Went with 1680×1050 which seems like an arbitrary number but with the highest (1920×1080) the text was blurry.

Could not detect which OS was on the disk, set it to Win7 x64. 4G RAM and 25G disk.

There’s a funny fish shown during first install.

After this, enter language and hit install, enter license key, custom install, use all disk.

This appears to be the current loading screen while the computer is booting too :)

After windows boots you get to decide hostname, enter your windows account, make some settings if you want to update drivers, safety filters. You can enter some extra security stuff (e-mail, alternative e-mail, security question).

 

Inside

To get to settings move the mouse cursor down to the bottom right corner.

A task bar is available if you move the cursor to the left top corner of the screen.

Xbox games doesn’t work (not allowed to sign in from my region).

Pinball FX starts but it’s lagging, a lot. But, if it’s slow just hit the windows key and you’re back to the block(s). In the end it doesn’t work either.

There’s a messaging square where you can add facebook, there’s also an e-mail square where you can add gmail.

Weather shows temperature as Fahrenheit, even though all my settings in control panel are set to Sweden/Swedish.

So I put some music on the skydrive, and then started it (whereupon it downloads the song). It then starts up a media player that takes up the whole screen. You can tell that this is meant to be used for a tablet where you don’t want clutter or where you want it to look nice.

Also, you go to settings to turn it off.

Dragonfly – Testing another OS

http://www.dragonflybsd.org/

Install

It’s based on … BSD! (FreeBSD 4.8 is apparently what dragonfly span off from)

What’s weird is that while VMWare Workstation scans the iso (to find which OS it is) it stops responding (other VMs are unaffected).
It finds FreeBSD 64-bit.

It has a ‘hammer’ filesystem.
Apparently this is unsupported for FS under 10GB and not recommended for under 50G and will apparently require a lot of things (period clean-up job) occasionally.

     HAMMER file systems are designed for large storage systems, up to 1
     Exabyte, and will not operate efficiently on small storage systems.  The
     minimum recommended file system size is 50GB.  HAMMER must reserve 500MB
     to 1GB of its storage for reblocking and UNDO/REDO.  In addition, HAMMER
     file systems operating normally, with full history retention and daily
     snapshots, do not immediately reclaim space when files are deleted.  A
     regular system maintenance job runs once a day by periodic(8) to handle
     reclamation.

 

Nice and straight-forward console-based installation.

Quick and easy!

Configure

As it’s BSD, add the user to the ‘wheel’ group so that it can become super-user.

Guide to get sshd working (basically set PasswordAuthentication = yes). The guide mentions a lot of other things, but in 3.0.1 sshd is on by default and the keys have been generated.

Install  software

Edit /usr/pkg/etc/pkgin/repositories.conf and add the URL to a repository near you.

pkgin update

pkgin full-update

pkgin search packagename

pkgin install bash

This installs bash to /usr/pkg/bin/bash

It’s not enough to just edit /etc/passwd to get the new shell, you need to edit it via ‘chsh’.

To install screen you need to

ln -s /usr/lib/libcrypt.so.4 /usr/lib/libcrypt.so.3

or it will complain that libcrypt.so.3 doesn’t exist.

The HAMMER filesystem

All commands start with ‘hammer’. Like ‘hammer info’.

 

Conclusion

While looking at it from the above angle (quite distant) – this doesn’t appear to be very different from other bsd/unix/linux distributions, a bit different commands to do some things but that’s not so odd in itself.

Personally I like the name, maybe that’s enough to use it? =)

ESXi + VMWare Workstation + OpenIndiana

Before

Register and download ESXi here https://www.vmware.com/tryvmware/

Free license can be found there as well.

Get ESXi and the vSphere Client.

Get an OS to install in a VM (I chose openindiana).

Install ESXi in VMWare Workstation 8.

40G disk, 4GB RAM, 2 cores, enable Virtualization.

Very fast install.

Actually, in VMWare Workstation you can do ‘connect to server’. So for this you do not need the vSphere Client? Looks like through VMWare Workstation there’s a lot less options. Supposedly you can upload stuff to the datastore through the vSphere Client, and possibly more. Basically in VMWare Workstation you can just create a VM and make basically the same settings on it as you would on a normal VM.

Username: root. No password.

In the console, enable ssh and stuff. Then you can scp and ssh to the esxi host.

/vmfs/volumes/datastore is where you want to put isos.

you can also browse to the datastore via http!

Install OpenIndiana in a VMWare Workstation VM running ESXi.

Connect to the ESXi server in VMWare Workstation (connect to server, put in the IP of the ESXi VM, the IP is in the console).

After it’s there just create a new VM and select a ‘remote location’ of the iso when you look under CD. I’m went with openindiana.

8G disk, 1GB RAM, 1 CPU, “VM Network” (I presume this means the same as the one where the VM is). Nothing else special during install.

Feels a bit slow, but that could be because of the 1GB RAM. But I increased this to 2GB and still the Grub menu was slow to load.

Using OpenIndiana

In the console hit: ‘pfexec su -‘ to get to the root shell.

From the start I can ping a DNS-host on the internets. Great success.

Static IP in OI

If you don’t want to use nwam and you want to have a static IP you do this in the console:

  • Find interface name with ‘ifconfig -a’ or ‘dladm showphys’. If it’s not visible with ifconfig, it’s not plumbed, so ifconfig devname plumb. For this example, we’ll use e1000g0
  • Disable NWAM: svcadm disable svc:/network/physical:nwam
  • Set IP address in /etc/hostname.e1000g0: echo 1.2.3.4 > /etc/hostname.e1000g0
  • Set netmask in /etc/netmasks (there’s an example in there)
  • Set default gateway in /etc/defaultrouter: echo 1.2.3.1 > /etc/defaultrouter
  • Set DNS servers in /etc/resolv.conf (example: printf “nameserver 1.2.3.4\nnameserver 2.3.4.5\n” > /etc/resolv.conf)
  • Enable default: svcadm enable svc:/network/physical:default
  • Restart networking: svcadm restart svc:/milestone/network:default

After this, restart the system (init 6) and see if the settings stick. (I had to restart the VM twice but the IP setting stuck). The OI VM stuck at boot a few times after this as well. poweroff/restart got it back without any issues though.

Packages in OI

this is how to update your OI (no questions asked, just update everything).

pkg install pkg:/package/pkg
pkg update

You can of course do a lot more, see http://wiki.openindiana.org/oi/3.+Installing+software+and+package+management

Installing stuff

pkg install irssi

easy peasy, no problems at all (and screen is installed by default!).

JAVA is already installed by default (1.6.0.26).

java -version

Install Open Solaris in VMWare Workstation

Trying out osol-dev-134-x86.iso in vmware workstation.
You can download it from here: (genunix.org doesn’t work anymore – here is another place: http://okcosug.org/. Update 201308 this also broke. You can now use http://virtualboxes.org/images/opensolaris/)
Host OS: Core i7 with Windows x64.

1 core and 1300MB RAM, bridged networking and 16GB disk.

Installation looks initially very similar to openindiana (I guess it is the other way around..). Choose keyboard layout etc.

When you boot on the disc above you get directly into a desktop. If you only want text you can use the textinstall-134-x86.iso on the same page as above, the openindiana text-based installer had some more options than the ones in this graphical one in opensolaris. From there you can click an icon to install it. It only asks you for user/pw, timezone and partitioning stuff. 3.6GB needed. Nothing more, no packet selection or role customization.

I was not expecting the graphical desktop. Networking works straight from the box. Flash does not. However you can just download a .so file and get it working. Just find out where firefox is installed and copy it to the plugins directory. But flash is apparently dying now anyway.

There is an update manager but it doesn’t find any updates. Even though this version is from 2010. ? Why? Do I have to register to get updates? Register page takes me to Oracle. Perl version is 5.8.x and latest Perl now is 5.14.x. Supposedly ‘pkg image-update’ should update but it appears to not work anymore. There is now Solaris Express or whatever Oracle calls it which I presume they want you to update to and pay for. Of course openindiana is still there but it doesn’t install on the bl460c.

Protip: To get root level permissions you type ‘pfexec su -‘ or just ‘pfexec bash’.

The main idea I wanted to do this was to see what ‘touch /reconfigure’ did.
All it did was to add ‘configuring devices’ during the boot.
Also tried this on a bl460c blade where we replaced the system board. Nothing special, it booted up just fine!

Windows 8 Developer Preview + VMWare Workstation

VMWare Workstation 8 is required (doesn’t work in 7).
The x64 version (without developer tools) installs just fine on my Win7 x64 Core i7 machine with virtualization enabled in BIOS.
Just disable the easy install bullcrap (you may have to remove the floppy drive).

Boots fine and logs on, can connect your Microsoft Live account to the computer. If you do connect it, you’ll get an e-mail to your Live e-mail asking if you did this and if you want to give this computer access to your account. Pretty integrated.

That’s how far I’ve gotten. Unsure if I’ll actually try anything more but it was nice to see that it works. Windows 7 has been so great to me (compared to 98, me, and xp) with very few problems that I doubt that I will upgrade for quite a while. Approaching 2 years, no reinstall yet and it’s still pretty quick. I suppose it all depends if Win8 is going to have some feature that I really do like/want.

If you just bring the mouse down to the right corner you get the start menu and a large clock, nice, no need to click. None of the apps worked (couldn’t click on them).
Looks nice and ‘streamlined’ or something, not too cluttered – nice.

Ubuntu 11 in VMWare Workstation

Time for another test! This time it’s Ubuntu 11.04 Natty.

My setup is a Intel Core i7 920 on Windows 7 x64 with 8GB RAM.

*** Update 2011-04-29 – I just heard that if you run this in a Virtual Machine you do not get all the shebang on the default graphical user interface. But for me it looks fine. Also when I looked on this video it didn’t look much different except for the left side bar. If you want to check out the supposedly nicer graphical user interface I would recommend that you put Ubuntu on a CD/DVD and then boot your desktop with it. That way you can see if it’s for you and if it works without doing anything to your hard drives :)

*** Update 2011-04-29 Also added link where to get Ubuntu 11.04 as now it’s not in beta anymore.

Installing

  1. Install VMWare Workstation
  2. Download the Ubuntu ISO. (I got the x64 / AMD64 one) from http://www.ubuntu.com/testing/natty/beta
  3. As it’s public now, you can get it from http://www.ubuntu.com/download/ubuntu/download
  4. Add new Virtual Machine (VM) in VMWare Workstation, browse to the .iso and it will with easy install find Ubuntu 64-bit.
  5. Gogogo! Chose language and set up your user account. That’s all. After that you can log on to the desktop. It took quite some time for me to install it – though I wasn’t in a rush so did not measure time and just left the PC. Maybe it went sleeping or something.

Uses 5.2GB effective disk space (checked properties on the directory from Windows) after install and that upgrade below.

After install.

Looks pretty smooth. Quite different from what I remember. I set it to 2GB  RAM and it’s only using 300MB from scratch. This is nice. And it turns off in a couple of seconds.

  • Unity thing in VMWare Workstation works from scratch (7.1.3 and 7.1.4). In 7.1.4 even with the VMWare Tools not installed updated.
  • First thing I ran was a software update – 160MB already after it being out only a couple of days. Guess some big package got an update.. however, no reboot required for it!
  • One thing you should be aware of, is that the program options/menu bar, is at the top of the screen, “File”, “View”, stuff like that. So quite a bit like Mac OS (if I’m not mistaken).
  • Audio is also working from start.
  • Resolution/screen proportions are automagically updated so that Ubuntu fits the whole screen. Nice. Ubuntu 10.10 does not do this in Virtualbox on RHEL6.

Comes default with these programs:

  • Mozilla Firefox 4.0
  • Libreoffice (not openoffice??) – looks like openoffice anyway.
  • Evolution Mail/calendar
  • Empathy chat cilent
  • Gwibber – twitter I guess
  • Transmission – torrent client
  • Shotwell photo manager
  • “ubuntu software manager” – where you download apps. There is still however apt-get and synaptic.

This “ubuntu software manager” is a bit of a fail. It seems very mainstream.

For example:

  • irssi cannot be found there

That’s about all I can think of for now.

Adobe Flash:

  • No flash from the start. But! Search for it in the software manager and you can install it. This however failed. I tried to report but it required a login so I skipped.
  • After fail the app still has a green check-mark on it.
  • Flash still works though. And it’s not lagging for me at all. But hey, I just tried it right after starting the browser. Maybe it gets choppier after some heavy browsing :p

Unity

The unity thing is pretty darn neat. What it does is it gives you an “extra” start-button. It’s not visible all the time, only when you go near your normal one – it pops out. With that you can then start a program from the Ubuntu virtual machine and it will look like any other program on your PC.

Supposedly Unity may work better after upgrading VMWare Tools. I got a little bar at the bottom of the screen, extracted and ran the thing. Then it was gone.

Conclusion

All in all, feels pretty good! I have some plans to get a laptop of mine up running this. Just need some other work done on it first I believe. There were some bugs, but that’s not surprising, considering it is in beta. Always liked ubuntu because installing it is so smooth. Might not be the most awesome for preserving system resources but honestly, only using 300MB from start is pretty ok isn’t it? If I get it on my laptop, I’ll definitely be trying another window manager, like awesome or dwm –  should bring the memory usage down :)

Time Sync for Linux VMs in VMWare Workstation

You may have seen in my previous post about EyeOS that I tried many things to get time in sync on the virtual OS. It was drifting lots of time and after a few hours it was an hour behind. Google tells me this is quite common but I could not find anything that decidedly fixed it.

run ntpdate every hour. This is not advised, primarily because it will add a lot of extra load after a while to the public(free) time servers. Especially if I want to have several machines up to date. One thought then was to set up a local ntpd and let other guest OS sync time with that. But then I could not get that in sync so we were back to square one.

others mention using VMWare tools time sync.

My setup:

Intel Quad Core i7-920
8GB RAM Corsair XMS3 DDR3 1333MHz 8GB CL9
Gigabyte GA-EX58-UD3R
Windows 7 x64
Vmware Workstation 7.1.1

What works for me

For ubuntu 10.10 x64:

Make sure vmware tools is installed (type vmware and hit ‘tab’).
With a .txt editor open up “vmname.vmx” on your host OS.
Set tools.syncTime = “FALSE” to “TRUE”. Restart vm.

Now on this particular machine I’ve had ntpd installed, but it is now uninstalled.

For Red Hat Enterprise Linux  5 x64 – RHEL 5:

  • Install vmware-tools (without make/gcc installed).
  • Set tools.syncTime = “TRUE”
  • Set up ntpd with the below from ntp.conf
  • Restart ntpd by getting root shell with ‘su -‘ and then ‘/etc/init.d/ntpd restart’

I filled out the ntp-information during installation and then after wards I added the “tinker panic 0” which should let the ntpd make ‘big jumps’ and by commenting the fudge-line I chose not to use the local clock because this is drifting so much.
More than 24 hours after I installed the OS the driftfile is still 0.000.

ntp.conf:

tinker panic 0
restrict default kod nomodify notrap nopeer noquery

restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#fudge  127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
restrict 0.rhel.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 1.rhel.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 2.rhel.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery

Ubuntu 10.10 + VMWare + Irssi

How small VM can you make if you are only going to use it to run Irssi in a screen?

OS: Ubuntu 10.10 x64 Virtual Kernel
Hypervisor: VMWare Workstation

Disk – no logs – 1.10GB is what my previous took, with samba, so probably less but 1.1 should be all right, don’t want it to run out of space either. Should probably partition /var/log into its own so that if that fills up (maybe after bruteforce ssh logins) then it doesn’t fill up the rest of /.
RAM –

  • turn off cron jobs
  • install virtual kernel

about the cron jobs, I just installed a ubuntu virtual kernel and only cron job running (as seen in syslog) is this:

CRON[9141]: (root) CMD (   cd / && run-parts –report /etc/cron.hourly)

Test 1

1.2GB disk
64MB RAM

Kernel panic – not syncing: attempted to kill init!
ctrl-alt-del in the VM doesn’t work, had to hard kill it :p
Reboot – same problem. It does this after selecting minimal virtual kernel and pressing install Ubuntu Server.

Test2

Increased RAM to 96MB and now it passed.
However, after selecting keyboard it still crashes. So 96 is also too little.

Googled around a little and found an article on Ubuntu.com that gives some insight.

For example: if you run out of memory, then it will swap. So if you are not running out of memory then it’s probably better to give it a little more to be on the safe side.

Test 3

Increased RAM to 128MB
Now it goes even longer.

Partitioning -> chose manual.
There is a device there ‘sda’ -> SCSI3. Mark that and hit enter. Say yes to create new empty partition. Then it creates a new space pri/log. Create new partition.

As size, type in: 100MB
Primary, beginning, default settings on the filesystem etc but mount point: /var/log. Then done setting up this partition.

Then we will create another partition for / (or the rest).

Like this:

ubuntu_partition right

ubuntu_partition right

The above does not include a swap space, and the installation complains that there is no swap space defined and that there may be problems if this is not configured during install.

Let’s see :)

** maybe Ubuntu is not the slimmest OS to install for this purpose. The guide I linked to above mentions a DSL – damn small linux. But we want a minimal server OS, not a desktop one. Maybe the new Debian 6 would be cool to try.

During install there was a dialogue about something being already on the disk.. and that this could cause issues. Maybe this was copied there from one of the previous tries with less amount of RAM. Went back and erazed this on each just to be on the safe side. Very slow though. About 1% / s. After this I went into each and set them to format instead. It mentions old installation files anyway. Proceeding. This happened twice? Three times now.. Maybe this is not going so well. Ok happened four times.

Hit Alt+F2 (and then enter to get the console) and then df -h. Nothing is over 20% except the SR0/cd-rom which is at 100%. Did a ‘more /var/log/syslog’ and at the end there are some ‘Out of memory’ things going on.

So there we go. 128MB is too little.

But here:  it says that 128MB is the requirement..

Test 4

I will try to install again and not mess up with the partitions.
1.2GB and 128MB again.
Going pretty well, looks like it’s stopped at 75% and “storing language”. Patience. Ok, 10mins later still there. Nothing about out of memory in /var/syslog. The Guest was behaving a little slow though when working the console.
Left it on over night and when I looked again the following day it was at the next step!

Installing openssh via the installation menu this time.
Taking quite long time this time as well. Like hours. 2 hours now. Nothing happening in syslog. Think I’ll give Debian a shot next Test.

In the meantime did Test 5. However 4 hours later, still configuring ‘language-pack-en-base’.

Now, approximately lots of hours later. It is at configure grub.

And yay, it finally boots!

user@irssi:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             1.1G  430M  606M  42% /
none                   54M  164K   54M   1% /dev
none                   57M  4.0K   57M   1% /dev/shm
none                   57M   36K   57M   1% /var/run
none                   57M     0   57M   0% /var/lock
none                  1.1G  430M  606M  42% /var/lib/ureadahead/debugfs
/home/martbhell/.Private 1.1G  430M  606M  42% /home/martbhell

And the size of the folder in Windows: 750 MB (787 341 312 bytes)

With 128MB ram there is maybe 10MB free and it swaps a little (just a few kB so far).

Test 5

debian-6.0.0-amd64-netinst
Using Debian 5 64-bit.

  1. graphical menu is seen, no advanced options used
  2. chose languages – look a lot like Ubuntu but there are some differences:
  3. After choosing a hostname it asks for domain. Put in WORKGROUP.
  4. Set a root account password (so no more sudoing – probably just add my user to the wheel/root group).
  5. and you have a few more options in the partitioning, like a separate /home partition
  6. then you get to chose a debian mirror (becuase I use the netinst). ftp.fi.debian.org is the one I chose
  7. you can participate in a “most used packages” survey
  8. software selection: graphical desktop, web, dns, ssh, laptop, standard system utilities. I chose SSH and standard system utilities.
  9. grub, then reboot and loading!

Internet works fine from the start. apt-get update; apt-get install irssi
Remember, here you have to log in as root to run ifconfig or apt-get.

It’s the same way in Debian as in Ubuntu to set static ip. Just edit /etc/network/interfaces / don’t forget you can just restart the networking services by ‘/etc/init.d/networking start’ instead of rebooting ;)
Now, I actually forgot to set minimal ram/disk for this one. So we have to do this again ;)

Test 6

debian-6.0.0-amd64-netinst
Using Debian 5 64-bit.
128MB RAM

One thing that’s cool about a VM is that you can resize the amount of RAM whenever (probably good to turn off the guest first). So how about just lowering it instead of installing a new one?

OK, so it now has 512MB. Going down to 64 in one go (listed as minimum in VMWare Workstation).

It’s swapping after just a few minutes with screen+irssi.

to sort by memory usage in top press SHIFT+m

biggest memory hogs (all over 1% – figures in bold) are :

1474 user 20   0 23388 6220 1572 S  0.0 11.2 0:00.25 bash
1503 user 20   0 50084 5228 3824 S  0.0  9.4 0:00.06 irssi
1470 root      20   0 70488 3280 2584 S  0.0  5.9 0:00.03 sshd
913 root      20   0  117m 1788  904 S  0.0  3.2 0:00.01 rsyslogd
1473 user 20   0 70488 1680  964 S  0.0  3.0 0:00.06 sshd
1502 user 20   0 25184 1472  992 S  0.0  2.6 0:00.01 screen
1546 user 20   0 19040 1300 1004 R 99.9  2.3 0:00.01 top
985 root      20   0 22392  712  512 S  0.0  1.3 0:00.00 cron
1233 Debian-e  20   0 44140  660  392 S  0.0  1.2 0:00.00 exim4
1472 root      20   0  5928  620  520 S  0.0  1.1 0:00.00 getty
1 root      20   0  8352  616  560 S  0.0  1.1 0:01.42 init
1277 root      20   0 49168  544  428 S  0.0  1.0 0:00.00 sshd

What I might be able to get rid of is rsyslogd and cron. But then again, if I were to connect this to the internet so I could access it and resume the screen/irssi from anywhere, I would want to keep track of what is happening on the machine.

user@debian:/var/log$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             3.8G  638M  3.0G  18% /
tmpfs                  28M     0   28M   0% /lib/init/rw
udev                   23M  140K   23M   1% /dev
tmpfs                  28M     0   28M   0% /dev/shm

Windows usage: 887 MB (930 816 000 bytes)

Summary

The Ubuntu Server 10.10 with the minimal virtual kernel took forever to install (maybe it would have been faster to have more mem during install and then lower when it’s done) and with 128MB it still swaps a little with only screen and irssi running. But it does use about 130MB or 200MB less space than the Debian6 guest.

The Debian 6 however runs OK with 64MB, swaps a little at that though so I would probably run this with 96 or 128MB just to be on the safe side if I were to run it.

VSP / VMAX / VAAI

Lots of acronyms :)

VMAX – EMC
VSP – HDS
VAAI – VMWare’s Storage API

I really liked a post by the storage anarchist as it quite eloquently explains what is happening and a great benefit of VAAI. Granted the post primarily speaks about the eraze part and I’m not that knowledgeable about VAAI itself to tell if there are any other features – but there is – at least according to this article on vmetc.com. This does not focus on the same two features that the anarchist mentioned. Maybe the storage anarchist did not want to mention all of these other features because they actually do work quite well for arrays that are behind the VSP.

File share from Ubuntu 10.10 with Windows 7 Client

Figured I would give this a shot and see how this is done in Linux.

Overview

1x Ubuntu 10.10 VM in VMWare Workstation. Installed with virtual kernel.
1x Windows 7 VM. All updates.

Not going to go through the installations in this post, just the domain/LDAP part. See previous posts for installation stuffs.

Found this article on ubuntu.com -> -> 10.10/serverguide/C/network-authentication.html .. But this does not exist anymore.

Whoa, quite a lot to do. Think I will read the manuals this time :)

Basically I think I just need to install and then configure Samba.
Because it has file-sharing and authentication/authorization.

So, first step will be to install Samba and try file-sharing.

File Sharing

sudo apt-get install samba

installs these:

The following NEW packages will be installed:
libavahi-client3 libavahi-common-data libavahi-common3 libcups2
libfile-copy-recursive-perl libgnutls26 libldap-2.4-2 libsasl2-2
libsasl2-modules libtalloc2 libtasn1-3 libwbclient0 samba samba-common
samba-common-bin update-inetd

After that I can run \\192.168.0.ip which is the IP of the VM running samba – it gives me a login prompt.

Uncommenting this in /etc/samba/smb.conf

[homes] comment = Home Directories
browseable = yes

Still asks for a password. Tried with user@ip – this seems to work. It shows a directory called “homes” but it doesn’t work to browse into it.

[2011/02/06 16:30:45.949726,  1] smbd/service.c:678(make_connection_snum)
create_connection_server_info failed: NT_STATUS_ACCESS_DENIED

Set ‘share’ and set the guest account = nobody  then I got this:

[2011/02/07 13:22:06.770082,  0] smbd/service.c:988(make_connection_snum)
canonicalize_connect_path failed for service foo, path /mnt/foo

Then what I did was this:

  1. created a directory called /samba
  2. sudo chmod +x /samba
  3. sudo chmod 777 /samba
  4. sudo chown nobody /samba
  5. add this to /etc/samba/smb.conf
  6. [foo] comment = foo
    path = /samba
    read only = no
    guest ok = yes
    guest only = yes
    browseable = yes
  7. security = share
  8. guest account = nobody

And then \\ip\foo and woopsie! I can both write and read :)

[2011/02/07 13:23:14.022980,  1] smbd/service.c:1070(make_connection_snum)
192.168.0.ip (192.168.0.ip) connect to service foo initially as user nobod

yay!

EyeOS – Cloud Desktop in your browser – Part 2

After my first comment ever by Adrian from the eyeOS forum I will now try this again and try not to install eyeOS wrongly by following a guide!

1/ Because I also tried to install cactii on the same VM the other day – and after that I saw some nasty out of memory messages. I will create a new VM – fresh, and with only 256MB RAM!

However, the guide is only for 2.x – So I will freestyle this time too. But follow the installation instructions on eyes.org :)

Overview

1/ Install Ubuntu 10.10
2/ Follow guide Not possible because uh, there is none for Ubuntu. There is one that begins with graphic interface for Debian.
3/ Win!

Requirements – PHP5

Installing Ubuntu

I use VMWare Workstation.
File -> New VM. Typical, installer disc image.
I used ubuntu-10.10-server-amd64 – I have an intel core i7.. (this is the one I used before, tried to find on ubuntu.com which one I should use but it says if you have a 64-bit, you’ll get the amd64..). Anyway. and also apparently it’s possible to press F4 during install and it will install a ‘virtual kernel’ which is good for when running in a virtualized environment! I had to change memory down to 256MB and then I also set the network type to “bridged” – so that it gets IP/DNS settings from my router instead of from my computer.

Also found a forum post that confirms, if you have an Intel 64-bit CPU – it is the “amd64” version you want to install.

So first time when I entered the VM through the VMWare shell everything worked fine.
Except that they keyboard was a bit messed up. When I pressed down it sent an enter.
In SSH via PuTty it’s working so I’ll do it that way instead. If you have this problem, check out this post – might be a VMWare bug or you may fix it with some CLI magic.

sshd is not installed by default -> sudo apt-get install openssh-server

Also probably good to change IP in the beginning, in case you want it on a static IP.
See my previous post how to set that. It’s a at the bottom of the post.

Time

Another good thing would be to set the time zone on the VM. You can find out how to do that in this post about lifehack/currency exchange rate.

To sync the time – so that it is up to date (mine was 30mins off) –

Edit /etc/default/ntpdate
Add a pool or use the default one – http://www.pool.ntp.org/zone/fi for Finnish ones.
Then run sudo ntpdate-debian

Do I really need to run this anymore? I’ll just let it be and try to keep track of it :p

*** Update: Just checked in on the time some 2 hours later and:

4 Feb 14:43:45 ntpdate[2494]: step time server 194.100.2.198 offset 910.266238 sec

So we need to have this executed every now and then, especially if it’s off 15minutes in just a couple of hours!!

Also found post on debian.org which clearly says that ntpd is awesome for fixing this. Especially in my case where the clock appears to be going slowly.

sudo apt-get install ntp
sudo pico /etc/ntp.conf

add your NTP-servers in there, I added those from the link above on ntp.org

then if you run this: sudo /etc/init.d/ntp status
it will tell you if it is running or not

I’ll check back tomorrow to see if this improved things ;)

*** 0847 unfortunately time is by now almost an hour off (0757).

martbhell@ubuntu:/var/www$ sudo /etc/init.d/ntp status
* NTP server is running

martbhell@ubuntu:/var/log$ ntpq –peers
remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
europium.canoni 193.79.237.14    2 u   12   64  377   44.012  2995645 13778.9

but supposedly this only runs once a day?

there is a program called ntp under /etc/cron.daily/

i’ll wait until today afternoon

** 2045  – it is now over an hour late..
** rebooted, now time is 2215.. 23 minutes too much!
** rebooted again, now time is good, 2054. :s

** a day later (maybe more)- and now it’s 3 hours behind.

supposedly ntpd will catch the drift after a while.

stopped VM and made a copy of hostname.vmx

then edited this with pspad and and changed

tools.syncTime = “FALSE”

to

tools.syncTime = “TRUE”

now time is good (Tue Feb  8 15:12:34 EET 2011), is that because of the reboot? Probably. That’s how it looks in syslog anyway.

Checking back in a day or two.

*** Wed Feb  9 06:45:09 EET 2011 – now 45minutes late.

*** Set up a script that monitors the offset. Looks like this:

offset = 3287.419925,;Tue Feb 15 04:30:01 EET 2011;
offset = 3634.005591,;Tue Feb 15 06:30:01 EET 2011;
offset = 3980.517817,;Tue Feb 15 08:30:01 EET 2011;

347,346,374

From /etc/ntp.conf I found that the drift file is this:

/var/lib/ntp/ntp.drift

it contains this value: 0.000

Manually changing this to -346.500

Also changed the default values to this in /etc/ntp.conf

restrict -4 default kod notrap nomodify
restrict -6 default kod notrap nomodify

#restrict 127.0.0.1
#restrict ::1

and rebooting the server, again.

bbl.

ok, this is bs.

sudo apt-get remove ntp

then running this:

sudo ntpdate 0.fi.pool.ntp.org

confirmed it updates time

44 * * * * /usr/sbin/ntpdate 0.fi.pool.ntp.org >> /home/user/tid/tid.log

bbl

ok, looked one hour later at 1445 and the time was right.
can now keep an eye on that tid.log file instead :)

don’t forget to add that to the root user crontab, with ‘sudo crontab -e’

*** a week later

ok that was an ugly fix and I do not condone doing that, that was me being a little frustrated :)

See http://www.guldmyr.com/blog/time-sync-for-linux-vms-in-vmware-workstation/ for how it worked out..

lamp

Download 1.x

install LAMP -> sudo apt-get install lamp-server^
The ^ needs to be there! All you need to do is to insert a mysql root password.

After this you can surf into http://localhost or http://ip of the VM.

phpymadmin

I also want to put in phpmyadmin (sudo apt-get install phpmyadmin) as well, this is nice tool to manage the mysql db. In that installation, choose apache2 by pressing space, then tab to get to the OK button. Then it asks about dbconfig-common, I chose no here because the db(mysql) is already installed. Then surf to http://ip/phpmyadmin/ and log on. If you see any databases there already -> you are now connected to the mysql you created before! Woop!

EyeOS Install

cd – this gets you to your homedir
mkdir eyeos
cd eyeos
wget $URL of eyeOS
install unzip -> sudo apt-get install unzip
unzip $FILENAME
put this in your web dir.
by default this is /var/www
by default you do not have permission to put files there, so use sudo to put the eyeOS folder in there.

sudo mv eyeOS /var/www
after this the user you have logged on with have ownership inside /var/www/eyeOS – means you don’t have to write sudo all the time :)

point your web browser to http://ip/eyeOS (note that it is case sensitive)
it will tell you that you need to chmod 777 some files, do that.

Then it will tell you to install these packages: SQLite and IMAP if you want mail client.

sudo apt-get install php5-sqlite (restart apache with ‘sudo apachectl restart’ and hit F5 on the installation page to see that the installation script now finds it)
sudo apt-get install php5-imap (free-styled that, worked out well ;)

put in a password and then hit install

then it’s installed!

eyeOS – nice!

It’s a lot slimmer than eyeOS 2.x and stuff appears to be working just off the bat.
Everything runs so fast too, in comparison to 2.x.

1.9.x for the win!

Do I really want to use this? Would I find it useful? Honestly I am a little scared by running this on my own pc.