PAGES

Thursday, 31 May 2012

Sharing CentOS Files with Remote Windows Systems- SAMBA

Sharing CentOS Files with Remote Windows Systems- SAMBA

Although Linux is increasingly making inroads into the desktop market, its origins are very much server based. It is not surprising therefore that Linux has the ability to act as a file server. It is also extremely common for Linux and Windows systems to be used side by side both in home and business environments.

It is a common requirement, therefore, that files on a Linux system be accessible to both Linux, UNIX and Windows based systems over network connections. Similarly, shared folders residing on Windows systems must also be accessible from CentOS systems.

Windows systems share resources such as file systems and printers using a protocol called Server Message Block (SMB). In order for a Linux system to serve such resources over a network to a Windows system and vice versa it must, therefore, support SMB. This is achieved using Linux based technology called Samba. In addition to providing integration between Linux and Windows systems, Samba may also be used to provide folder sharing between Linux systems.

In this tutorial we will look at the steps necessary to share file system resources and printers on a CentOS system with remote Windows and Linux systems.

Samba and Samba Client

Samba allows both CentOS resources to be shared with Windows systems and Windows resources to be shared with CentOS systems. CentOS accesses Windows resources using a package called samba-client. CentOS resources, on the other hand, are shared with Windows systems using a packages called samba.



Typically, the samba-client is installed and configured by default allowing you to browse available Windows resources without any additional work (this is covered later in the chapter). In order to allow a CentOS system to share resources with Windows systems some more work is required.

Installing Samba on a CentOS System

The default settings used during the CentOS installation process do not install the samba package. Unless you specifically requested that Samba be installed it is unlikely that you have Samba installed on your system. To check whether Samba is installed, open a terminal window (Applications -> System Tools -> Terminal) and run the following rpm command:

rpm -q samba 
 
 
If Samba is installed, the rpm command will generate output similar to the following:

samba-3.0.33-3..28.el5
 
If Samba is not installed, rpm will return with "package samba is not installed". That being the case, it can be installed using the yum command-line tool:

su -
yum install samba 
 

 The above command will install both the samba package and the samba-common dependency package. If you prefer to use the graphical tool to perform the Samba installation, select Applications ->  Add/Remove Software, enter the root password if prompted to do so and then perform a search for Samba. When the list of matching packages appears, set the checkbox next to the samba and samba-common packages and click on Apply to initiate the installation.

Starting the Samba Service on CentOS

Having installed the Samba service packages, the next step is to start those services running. This can be done either from the command line, or from the Service Configuration Tool.
To verify that the Samba service is running from the command-line execute following command from a Terminal window:

/sbin/service smb status
 
If the service is stopped it can be started as follows (note that this command must be performed with super user privileges):

su -
/sbin/service smb start
 


Alternatively, to configure the Samba service using the GUI based Service Configuration Tool, select it from the System -> Administration -> Services menu. When the tool loads, scroll down the list of services to find smb, select it and click on the Start button. If you want the service to start on reboot make sure that the checkbox next to the entry is selected and click the Save button in the top toolbar. Check the status panel to the right of the dialog to verify the service is running before exiting from the Service Configuration tool.

Configuring the CentOS Firewall to Enable Samba

Next, the firewall needs to be configured to allow Samba traffic. To achieve this, run the Firewall Configuration tool by selecting the System -> Administration -> Security Level and Firewall menu option and select the check box next to Samba in the Trusted Services section of the tool. Click Apply and OK to commit the change.

Once the Samba service is installed and running on the system and the firewall configured appropriately, the CentOS system should be listed within the Networking section of Windows Explorer on any Windows machines on the same network. For example, the following figure shows a CentOS system.

Before any resources on the CentOS system can be accessed from the Windows systems, however, some additional configuration steps are necessary.

Configuring Samba Users and Resource Sharing

Once the Samba File sharing is installed and running, the next step is to configure the users that are allowed remote access and also the file system directories (also known as folders) to be shared with the Windows systems.

The easiest way to achieve this is to use the Samba Server Configuration tool. As with the Samba server packages it is likely that this tool was not installed by default on your CentOS system. To check if it is installed run the following command in a Terminal window:
 
rpm -q system-config-samba

If the tool is not installed it may be installed as follows:

su - 
yum install system-config-samba
 
Once installed, the Samba Server Configuration may be launched from the System -> Administration -> Server Settings -> Samba desktop menu option, or from the command-line:

system-config-samba
 
When loaded, the Samba Server Configuration tool will appear as follows:

Select Preferences -> Server Settings... and enter the name of the Windows Workgroup to which you wish this server to belong and click OK.

Select Preferences->Samba Users... and select a user from the list which will be used to share folders with the Window's system. After selecting the user, enter the corresponding Windows user name which will be mapped to the Linux user you just specified and provide a password to be used for share access. Click on OK.

Click on the Add button in the toolbar to add a new folder to share. The following dialog will subsequently appear:


Type or browse to the path you wish to share and enter a share name if you do not like the one provided by the tool. Set the Writable and Visible toggles to your desired settings and click OK


Select the Access tab and either select a user added in the previous step, or allow access to all users.


Click on OK when you have configured the information in this dialog. The main dialog should appear with the new share listed:


Once completed, the folder you specified will be visible from any Windows systems on the same network (and workgroup specified in the Server Settings page) as your CentOS system. You should now have remote access to your Linux folder from the Windows system.

To achieve this, Select Map Network Drive from your Windows Machine


Provide the Folder path of the Linux drive that you just shared using Samba. Click Finish when done.


you will be prompted to enter the username and password for the share access. This is the username password that you supplied during the share creation on the Linux machine.


you will see the Linux drive show up as described below. NOTE the below image is also showing the drive size. We had attached a 10 GB external drive to this CentOS VM.

To know more on how to attach a external drive to a CentOS VM, CLICK HERE.


Accessing Windows Shares from CentOS

As previously mentioned, Samba is a two way street, allowing not only Windows systems to access files and printers hosted on a CentOS system, but also allowing the CentOS system to access shared resources on Windows systems.

This is achieved using the samba-client package which is installed by default under most CentOS configurations. If it is not currently installed, install it from a Terminal window as follows:

su –
yum install samba-client 
 
 
 
To access any shared resources on a Windows system, begin by selecting the Places -> Network Servers desktop menu option. This will display the Network browser dialog including an icon for the Windows Network (if one is detected) as illustrated in the following figure:


Double clicking on a computer will list the shared resources available for access from the CentOS client:


In this way, we have successfully configured a samba server on CentOS VM.

Further Reading:









Wednesday, 30 May 2012

How Server Virtualization Works

How Server Virtualization Works

Server computers -- machines that host files and applications on computer networks -- have to be powerful. Some have central processing units (CPUs) with multiple processors that give these servers the ability to run complex tasks with ease. Computer network administrators usually dedicate each server to a specific application or task. Many of these tasks don't play well with others -- each needs its own dedicated machine. One application per server also makes it easier to track down problems as they arise. It's a simple way to streamline a computer network from a technical standpoint.



There are a couple of problems with this approach, though. One is that it doesn't take advantage of modern server computers' processing power. Most servers use only a small fraction of their overall processing capabilities. Another problem is that as a computer network gets larger and more complex, the servers begin to take up a lot of physical space. A data center might become overcrowded with racks of servers consuming a lot of power and generating heat.

Server virtualization attempts to address both of these issues in one fell swoop. By using specially designed software, an administrator can convert one physical server into multiple virtual machines. Each virtual server acts like a unique physical device, capable of running its own operating system (OS). In theory, you could create enough virtual servers to to use all of a machine's processing power, though in practice that's not always the best idea.

Virtualization isn't a new concept. Computer scientists have been creating virtual machines on supercomputers for decades. But it's only been a few years since virtualization has become feasible for servers. In the world of information technology (IT), server virtualization is a hot topic. It's still a young technology and several companies offer different approaches.­

Why Use Server Virtualization?

There are many reasons companies and organizations are investing in server virtualization. Some of the reasons are financially motivated, while others address technical concerns:
  • Server virtualization conserves space through consolidation. It's common practice to dedicate each server to a single application. If several applications only use a small amount of processing power, the network administrator can consolidate several machines into one server running multiple virtual environments. For companies that have hundreds or thousands of servers, the need for physical space can decrease significantly.

  • Server virtualization provides a way for companies to practice redundancy without purchasing additional hardware. Redundancy refers to running the same application on multiple servers. It's a safety measure -- if a server fails for any reason, another server running the same application can take its place. This minimizes any interruption in service. It wouldn't make sense to build two virtual servers performing the same application on the same physical server. If the physical server were to crash, both virtual servers would also fail. In most cases, network administrators will create redundant virtual servers on different physical machines.
 
  • Virtual servers offer programmers isolated, independent systems in which they can test new applications or operating systems. Rather than buying a dedicated physical machine, the network administrator can create a virtual server on an existing machine. Because each virtual server is independent in relation to all the other servers, programmers can run software without worrying about affecting other applications.
 
  • Server hardware will eventually become obsolete, and switching from one system to another can be difficult. In order to continue offering the services provided by these outdated systems -- sometimes called legacy systems -- a network administrator could create a virtual version of the hardware on modern servers. From an application perspective, nothing has changed. The programs perform as if they were still running on the old hardware. This can give the company time to transition to new processes without worrying about hardware failures, particularly if the company that produced the legacy hardware no longer exists and can't fix broken equipment.
 
  • An emerging trend in server virtualization is called migration. Migration refers to moving a server environment from one place to another. With the right hardware and software, it's possible to move a virtual server from one physical machine in a network to another. Originally, this was possible only if both physical machines ran on the same hardware, operating system and processor. It's possible now to migrate virtual servers from one physical machine to another even if both machines have different processors, but only if the processors come from the same manufacturer.


Three Kinds of Server Virtualization


There are three ways to create virtual servers: full virtualization, para-virtualization and OS-level virtualization. They all share a few common traits. The physical server is called the host. The virtual servers are called guests. The virtual servers behave like physical machines. Each system uses a different approach to allocate physical server resources to virtual server needs.
Full virtualization uses a special kind of software called a hypervisor. The hypervisor interacts directly with the physical server's CPU and disk space. It serves as a platform for the virtual servers' operating systems. The hypervisor keeps each virtual server completely independent and unaware of the other virtual servers running on the physical machine. Each guest server runs on its own OS -- you can even have one guest running on Linux and another on Windows.

The hypervisor monitors the physical server's resources. As virtual servers run applications, the hypervisor relays resources from the physical machine to the appropriate virtual server. Hypervisors have their own processing needs, which means that the physical server must reserve some processing power and resources to run the hypervisor application. This can impact overall server performance and slow down applications.

The para-virtualization approach is a little different. Unlike the full virtualization technique, the guest servers in a para-virtualization system are aware of one another. A para-virtualization hypervisor doesn't need as much processing power to manage the guest operating systems, because each OS is already aware of the demands the other operating systems are placing on the physical server. The entire system works together as a cohesive unit.

An OS-level virtualization approach doesn't use a hypervisor at all. Instead, the virtualization capability is part of the host OS, which performs all the functions of a fully virtualized hypervisor. The biggest limitation of this approach is that all the guest servers must run the same OS. Each virtual server remains independent from all the others, but you can't mix and match operating systems among them. Because all the guest operating systems must be the same, this is called a homogeneous environment.

Which method is best? That largely depends on the network administrator's needs. If the administrator's physical servers all run on the same operating system, then an OS-level approach might work best. OS-level systems tend to be faster and more efficient than other methods. On the other hand, if the administrator is running servers on several different operating systems, para-virtualization might be a better choice. One potential drawback for para-virtualization systems is support -- the technique is relatively new and only a few companies offer para-virtualization software. More companies support full virtualization, but interest in para-virtualization is growing and may replace full virtualization in time.

Sources


Tuesday, 29 May 2012

VMware vSphere Best Practices- Guides and Links

VMware vSphere Best Practices- Guides and Links


Best Practice for vSphere 5.X

Best Practice for vSphere 4.X

Common Best Practice (vSphere 4 and vSphere 5)

Linux Virtual Machine Tuning Guide

Linux Virtual Machine Tuning Guide

1. Align your guest OS partitions for the best storage performance


Logical Block Addressing is a common addressing scheme for disks on PCs. However, under this scheme the master boot record causes partitions to start at a block that isn’t a power of 2.

This isn’t a huge deal for individual disks, but for shared storage where a LUN is actually striped across many different disks a single read or write by the guest OS causes twice as much I/O on the storage array. The misaligned partition has blocks that straddle the stripes on the array, and instead of reading a single stripe the array has to read from, or write to, two stripes. This isn’t a big problem on one or two VMs, but when hundreds of VMs have misaligned I/O the effect is crippling.

2. Install & use VMware Tools


This should be obvious, but unfortunately a lot of sites don’t install the VMware Tools. These tools add drivers for the para-virtualized network and SCSI adapters, add graphics drivers, and also enable the graceful shutdown & reboot functionality from vCenter. Seriously, just install them.

3. Use para-virtualized hardware where possible

VMware includes specialized hardware for network and SCSI adapters that can drive down CPU utilization and improve performance of individual VMs (and whole environments if they are widely used). It’s easy to use the VMXNET3 adapter, for instance, but there are a few caveats to using the VMware Paravirtual SCSI adapter, like not being able to use it for boot volumes. Regardless, if you can use it you should, because these settings improve performance.

Note that this isn’t the same as using VMI Paravirtualization. There are a lot of caveats to using that, and on any modern hardware with a Memory Management Unit that is virtualization-friendly you should leave VMI Paravirtualization off.

4. Don’t run anything you don’t need

Again, seems obvious, but Linux distributions tend to install a lot of stuff that you’ll never use. By not installing it you save lots of disk space, at least. Furthermore, a lot of Linux distributions assume that if X Windows (X.org, KDE, GNOME, etc.) is installed you are using the machine as a desktop, and may install screensavers and other things that will sap your performance.

As a general rule, if you don’t have a physical screen you don’t need a screensaver, so disable it or set it to blank & lock.

If you are comfortable running with a command line interface you can save a bunch of RAM and CPU cycles by booting into runlevel 3. Change the line in /etc/inittab that reads:

id:5:initdefault
 
to

id:3:initdefault
 
and on boot you will not get X Windows. You can always start it later by running ‘startx’ from the command line (but you’ll probably find that you can do everything you’d like from the command line).

5. Schedule jobs to not run simultaneously


Linux distributions often have some common system maintenance tasks scheduled automatically, like log rotations, locate database updates, etc. These can be quite I/O intensive. Likewise, things like system monitoring tasks often are scheduled to run at the same time on all hosts (at 0, 15, 30, and 45 minutes after the hour, for example). If you can introduce a delay in these tasks that would help spread the load out.

One super simple trick I use in /etc/cron.daily/logrotate and /etc/cron.daily/mlocate.cron is to sleep for a random amount of time.

The bash shell has $RANDOM, which generates a random number between 0 and 32767. For example, if you can wait up to 5 minutes to do these things try adding:

/bin/sleep $((RANDOM/109))
 
to the scripts (109 = 32767/300 seconds). I do this with log rotations, mlocate database updates, monitoring system scripts, backup jobs, and anything that runs at a common time, changing the divisor to meet whatever time frame I need.

6. Follow VMware’s best practices for timekeeping


First, use NTP and not the VMware Tools time synchronization to keep the system clock up to date. Second, use the recommended kernel parameters for the kernel and distribution you’re running. Third, run the newest kernel you can. For example, every update that comes out for Red Hat Enterprise Linux 5 has new virtualization optimizations in it. Getting timekeeping right is important, not just for accurate system time for logs and scheduling but because cryptographic operations rely on system time, too.
Check VMware KB article 1006427 for information on the kernel parameters and some suggestions for setting up NTP.

7. Set your disk scheduling algorithm to ‘noop’


The Linux kernel has different ways to schedule disk I/O, using schedulers like deadline, cfq, and noop. The ‘noop’ — No Op — scheduler does nothing to optimize disk I/O. So why is this a good thing? Because ESX is also doing I/O optimization and queuing! It’s better for a guest OS to just hand over all the I/O requests to the hypervisor to sort out than to try optimizing them itself and potentially defeating the more global optimizations.

You can change the kernel’s disk scheduler at boot time by appending:
 
elevator=noop
 
to the kernel parameters in /etc/grub.conf. If you need to do this to multiple VMs you might investigate the ‘grubby’ utility, which can programmatically alter /etc/grub.conf.

8. Collect performance data from vSphere, not from the guest OS


This is along the same lines as “don’t run anything you don’t need” but it deserves mention separately, because a lot of people are doing it. The Performance Best Practices document from VMware puts it well:
"Timing numbers measured from within virtual machines can be inaccurate, especially when the processor is over-committed… Measuring performance from with virtual machines can fail to take into account resources used by ESX for tasks it has offloaded from the guest operating system, as well as resources consumed by virtualization overhead."
If you can avoid polling the guest OS for performance data you gain performance by not having to do that work, plus you get more accurate data.

9. Don’t oversize your VMs, and configure them for hot-add

A lot of software vendors specify that their products need 16 GB of RAM, or 4 CPUs, or some other generic amount of resources that may be a complete waste in your environment. Because you can see the actual RAM and CPU utilization easily within vCenter you can opt to undersize your VMs, and only allocate more resources when it’s shown that they need them.

This improves performance, as it’s easier for ESX to schedule VMs with fewer CPUs, saves swap file disk space, RAM, and time during vMotions. Memory over commit can help cope with overallocation, but it is better if you just don’t over allocate to start with.

You can enable the hot-add memory and CPU features in vCenter for your VMs, if you are running recent operating system releases. Need more memory? Just add it. Need another CPU? Just add it. VMware KB 1015501 has information on configuring the CPU hot-add features in Linux so the new CPU is automatically activated.


10. Disable file system access time updates


File systems keep track of when files are created, modified, and accessed. The operations to update the last accessed times become extra writes, which are expensive in terms of I/O. As such, if you don’t need to do them, don’t. This probably won’t gain you a lot of performance on an individual VM (IBM says 0 to 10% depending on the workload), but in aggregate across hundreds of VMs you will likely see improvements.

To disable access time updates add ‘noatime’ to the mount options in /etc/fstab. For example, this line:

/dev/Volume00/LogVol00  /     ext3    defaults        1 1

becomes

/dev/Volume00/LogVol00  /     ext3    defaults,noatime      1 1

It requires a remount of the file system to take effect, such as a reboot.

Thursday, 24 May 2012

How Big WIll The Internet Be In 2015?

How Big will the Internet be in 2015?


Answer, pretty big, no let me re-phrase, ginormous!!


In the following infographic, Cisco try to demonstrate just how big the web is going to get in only a few short years.  As the content we consume gets bigger, more visual and of higher quality the amount of data passing through servers, down phone lines or over the air will continue to grow exponentially.


Wednesday, 23 May 2012

Adobe Creative Cloud: Creation On The Cloud

Adobe Creative Cloud: Creation On The Cloud


 

Sometime back, creative software giant Adobe released the long-awaited CS6, which comes with Creative Cloud.



Creative Cloud provides a simple subscription option ($50/month) to access Adobe’s complete Creative Suite (Photoshop, Illustrator, Indesign, After Effects, Dreamweaver and Flashbuilder), which costs $2600 to buy retail. The package also includes a 20 GB free storage space for storing files.

While this is not a typical SaaS model, and the applications still reside on client’s computers as in previous editions, this is a big step for Abobe, and the pricing model could be a disruptive influence in the sector.

What does Creative Cloud provide?




Easy storage and sharing on the cloud: While I could use Dropbox to store and load .PSDs (Photoshop), .AI (Illustrator) and .INDD (Indesign) files, Creative Cloud allows me to directly sync and share from the creative tools, apart from adding comments on the design. Also, there is a big storage space (20 GB) available that is needed for storing the resource-hungry creative files.
Subscription-based pricing model: Instead of paying $2600 upfront, the subscription model allows you to pay an ongoing payment of $50 (if taking a yearly contract) and could set the trend in creative software.
Getting updates and newer products in smaller chunks: Adobe releases a new version of its Creative Suite every 12–18 months. However, this way, they will be able to issue incremental releases.
Ability to install the product on two computers (one primary and one backup): In previous releases, Adobe provided the option to install a backup as long as it ran the same OS platform (Windows or Mac) as the primary installation. Now, that restriction has been removed.

Why is Creative Cloud significant?


I believe that Creative Cloud is important for the following reasons:

  • It is the first big venture by Adobe in cloud computing. The company has not made big ventures beyond the desktop, and its new strategy could be interesting. While this is already a good start, Adobe wants to take Creative Cloud further and build it into a social network where artists can share work and professionals can comment on it.

  • While the subscription-based pricing model has already become the norm in productivity tools and project management (with the likes of 37 signals and Salesforce.com), creative tools are still firmly attached to the desktop world. Now, this venture brings mainstream creative and artistic tools to the cloud. While the application is not fully run from the cloud, it signals a first step that could revolutionize the cloud industry yet further.


The subscription-based software pricing model is something that is still in its infancy, and we are eager to see if Adobe’s entry will quicken adoption. Although a large percentage consumers are unhappy with the pricing, I believe that this could set the trend in computing.

Taming Big Data [A Big Data Infographic]

Taming Big Data [A Big Data Infographic]


Big Data can be a beast. Data volumes are growing exponentially.The types of data being created are likewise proliferating. And the speed at which data is being created – and the need to analyze it in near real-time to derive value from it – is increasing with each passing hour.

But Big Data can be tamed. We’ve got living proof. Thanks to new approaches for processing, storing and analyzing massive volumes of multi-structured data – such as Hadoop and MPP analytic databases — enterprises of all types are uncovering new and valuable insights from Big Data everyday.

Leading the way are Web giants like Facebook, LinkedIn and Amazon. Following close behind are early adopters in financial services, healthcare and media. And now it’s your turn. From marketing campaign analysis and social graph analysis to network monitoring, fraud detection and risk modeling, there’s unquestionably a Big Data use case out there with your company’s name on it.

We here at Wikibon are excited to present this compelling Big Data infographic, which we hope will help you better understand how your peers are applying Big Data today and inspire you tame the Big Data beast yourself. Check out videos, market forecasts and deep research at on our curated page about Big Data.


Blogged from: http://wikibon.org/blog/taming-big-data/

Sunday, 20 May 2012

Best Practices- Installing CentOS VM on VMware Workstation- Part 3

Best Practices- Installing CentOS VM on



VMware Workstation



- Part 3


ADDING EXTERNAL HDD AND FORMATTING IT


In PART 1 of this series, we successfully installed CentOS 5.8 on a VMware Workstation environment.. and in PART 2, I showed you how to install VMware Tools in CentOS manually..

In this continuation series (PART 3), I am going to show you how to add a additional virtual Hard Drive to the CentOS VM, that too without rebooting it..

There are two ways to configure a new disk drive into a CentOS system:

  • One very simple method is to create one or more Linux partitions on the new drive, create Linux file systems on those partitions and then mount them at specific mount points so that they can be accessed. This is the approach that will be covered in this tutorial.

  • Another approach is to add the new space to an existing volume group or create a new volume group.

When CentOS is installed using the default disk configuration layout, a volume group is created and called VolGroup00. Within this volume group are two logical volumes named LogVol00 and LogVol01 that are used to store the / file system and swap partition respectively. By configuring the new disk as part of a volume group we are able to increase the disk space available to the existing logical volumes. Using this approach we are able, therefore, to increase the size of the / file system by allocating some or all of the space on the new disk to LogVol00. This topic will be discussed in detail in Adding a New Disk to a CentOS Volume Group and Logical Volume.

First, we will add the Hard Disk to the VM...



Select your virtual machine, as you can see from the above PIC selected the virtual machine. Next press the "Settings' to open the Virtual Machine Settings dialog.

From the "Virtual Machine Settings" dialog select the "Add..." button at the bottom of the screen. From this dialog you can also modify how much memory you dedicate to the machine when it boots.



Next we will walk through the "Add Hardware Wizard" the process makes it very simple to add additional hardware to a predefined virtual machine. From this screen we can see the many types of hardware we can add to a virtual machine. You can emulate just about any piece of hardware that one can expect in a modern operating system. It definitely makes testing with different configurations and devices much easier. For our example we want to select "Hard Disk" and then select the "Next >" button.



In the next screen we see the three options for adding a new disk. We can "Create a new virtual disk", this will create a brand new disk on the guest operating system.

The second option, "Use an existing virtual disk", allows you to mount a disk from another virtual machine.

The last option is to "Use a physical disk", this allows you to mount a local physical disk to the operating system. This option is akin to NFS mounting a drive to a virtual machine. To add a new disk we select the "Create a new virtual disk" option and select the "Next >" button.



Next we want to select the type of disk. So in this step we want to select "SCSI (Recommended)" and the "Next >" button.



Now we want to set the size of the disk we are creating.

One of the nice features of VMware is that you don't have to allocate all of the disk when you create it. So if you create a 40 GB disk it doesn't have to take it all right away, the disk will grow as your virtual machine needs it. I will say this is a big performance hit you take when the disk has to extend, but for most applications its OK.

Also, I will warn that if the virtual disk grows and there is no physical disk left on the host operating system you will see a catastrophic failure and in most cases both the host and guest operating systems lock up and become unusable. (Don't say I didn't warn you !)

Lastly, you can split the files into 2GB sizes, while this isn't necessary, it just makes all the disks much easier to manage and move around. For this step we want to set our disk size (12 GB in this case), I chose to allocate the disk space right now.. 10 GB in size and Split disk into 2 GB files.



This is actually pretty simple in that you decide what you want to physically call the disk and where to put it. .vmdk is the extension for VMware virtual disks. After we name the disk we can select the "Finish" button which adds the disk to the virtual machine.



So now we can see that the new disk has been added to the "Virtual Machine Settings" within the selected virtual machine. From here the disk acts just like it would if you added a new disk to a standalone server. So we select the "OK" button to continue.



After we've logged in and accessed a terminal window as root (or another user with root/sudo priveledges) we first want to run fdisk -l to display list of partitions.

In Linux the first SCSI drive is sda, the second sdb, the third sdc, etc. since this was the second SCSI drive we added to the system, the device is known as /dev/sdb



As shown above, the new hard drive has been assigned to the device file/dev/sdb. At this point the drive has no partitions shown (because we have yet to create any).

The next step is to create one or more Linux partitions on the new disk drive. This is achieved using the fdisk utility which takes as a command-line argument the device to be partitioned:

The basic fdisk commands you need are:

  • m - print help

  • p - print the partition table

  • n - create a new partition

  • d - delete a partition

  • q - quit without saving changes

  • w - write the new partition table and exit

In order to view the current partitions on the disk enter the p command:



As we can see from the above fdisk output the disk currently has no partitions because it is a previously unused disk.

The next step is to create a new partition on the disk, a task which is performed by entering n (for new partition) and p (for primary partition):

In this example we only plan to create one partition which will be partition 1.

Next we need to specify where the partition will begin and end. Since this is the first partition we need it to start at cylinder 1 and since we want to use the entire disk we specify the last cylinder as the end.

Note that if you wish to create multiple partitions you can specify the size of each partition by cylinders, bytes, kilobytes or megabytes.



The next option is t. t is used to replace the type of the current partition.

You can list the different types of Partitions by pressing L as shown below.. this will list down all the available partition types..

for our example, we need a Linux Partition, i.e. number 83.. similarly, if you want to create a SWAP out of this new HDD, then the number would be 82 (Linux/ Swap). Type 83 and press Enter key to continue



Now that we have specified the partition we need to write it to the disk using the w command:



If you do a fdisk -l again, you will see the newly created Disk with the Partition table allocated as shown below.

The next step is to create a file system on our new partition.

We now have a new disk installed, it is visible to CentOS and we have configured a Linux partition on the disk.

The next step is to create a Linux Filesystem system on the partition so that the operating system can use it to store files and data. The easiest way to create a file system on a partition is to use the mkfs.ext3 utility which takes as arguments the label and the partition device:



In order to do this we need to create a mount point. A mount point is simply a directory or folder into which the file system will be mounted. For the purposes of this example we will create a /extra in root (/) directory to match our file system label (although it is not necessary that these values match): mkdir /extra

The file system may then be manually mounted using the mount command: mount /dev/sdb1 /extra

In order to set up the system so that the new file system is automatically mounted at boot time an entry needs to be added to the /etc/fstab file.

The following example shows an fstab file configured to automount our /extra partition:


With the appropriate configuration line added to the fstab file, the file system will automatically mount on the next system restart.

Further Reading:

Saturday, 19 May 2012

Best Practices- Installing CentOS VM on VMware Workstation - Part 2

Best Practices- Installing CentOS VM on



VMware Workstation



- Part 2


INSTALLING VMware TOOLS


in PART 1, we saw how to effectively install CentOS 5.8 on VMware Workstation...

in this PART, we will install VMware Tools in the VM..

NOTE: If you had selected Easy Install during the install process from Workstation, then this step can be avoided as Easy Install installs VMware-Tools automatically.. still if you ever want, you can install VMware-Tools anytime you want...

Benefits of VMware Tools


The followings are benefits of VMware Tools on your Guest OS:

  1. A set of VMware device drivers:

These drivers include:

  • Graphics Performance: VMware Tools installs a SVGA driver that increases vide0 refresh.

  • Efficient Memory Allocation: A memory control driver that is installed with  VMware Tools provides increased efficiency in memory allocation.

  • Accelerated Mouse Driver: For increased mouse responsiveness.

  • Optimized SCSI Driver: A Bus Logic SCSI driver provides faster I/O performance for some guest OS.

VMware Tools control panel:

The Tools control panel lets you modify settings.

  • Run Scripts: Scripts can be defined to run after particular events such as the VM starting up or shutting down.

  • Shrink the Virtual Disk: By reducing the amount of disk space a VM’s virtual disk takes up by removing empty unused space will lead to more usable storage on your hosts volume.

Connect External Devices:

  • You can connect external media devices such as a floppy (who uses those anymore)  or CD/DVD drive. These appear as a virtual device when presented within the guest

To summarize,Installing VMware Tools eliminates or improves the following issues:

  • Low video resolution

  • Inadequate color depth

  • Incorrect display of network speed

  • Restricted movement of the mouse

  • Inability to copy and paste and drag-and-drop files

  • Missing sound

Installing VMware Tools within X


Select VM > Install VMware Tools in your Workstation menu as shown:



When you choose VM > Install VMware Tools from the VMware Workstation menu, VMware Workstation temporarily connects the virtual machine's first virtual CD-ROM drive to the ISO image file that contains the VMware Tools installer for your guest operating system and you are ready to begin the installation process.

Double-click the VMware Tools CD icon on the desktop.

Note: In some Linux distributions, the VMware Tools CD icon may fail to appear when you install VMware Tools within an X windows session on a guest.

Extract the VMwareTools.tar to the Desktop as shown below:



In an X terminal, logged in as root (su -), configure VMware Tools by navigating to the path where we extracted the VMwareTools.tar contents.. in this case, its /root/Desktop/vmware-tools-distrib/

Once there, simply execute the vmware-install.pl file as shown below:

Respond to the questions the installer displays on the screen. Press Enter to accept the default value.

Note: Be sure to respond yes when the installer offers to run the configuration program.

Note: Some guest operating systems require a reboot for full functionality.


Installing VMware Tools from the Command Line with the Tar Installer


The first steps are performed on the host, within Workstation menus:

1. Power on the virtual machine.

2. After the guest operating system has started, prepare your virtual machine to install VMware Tools.

  • Choose VM > Install VMware Tools.

The remaining steps take place inside the virtual machine.

3. As root (su -), mount the VMware Tools virtual CD-ROM image, change to a working directory (for example, /tmp), uncompress the installer, then unmount the CD-ROM image.

Note: Some Linux distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands below. You still must untar the VMware Tools installer to /tmp.

Some Linux distributions use different device names or organize the /dev directory differently. If your CD-ROM drive is not /dev/cdrom or if the mount point for a CD-ROM is not /mnt/cdrom, you must modify the following commands to reflect the conventions used by your distribution.

  • mount /dev/cdrom /mnt/cdrom

  • cd /tmp

Note: If you have a previous installation, delete the previous vmware-distrib directory before installing. The default location of this directory is
/tmp/vmware-tools-distrib.

4. Untar the VMware Tools tar file:

  • tar zxf /mnt/cdrom/VMwareTools-5.0.0-<xxxx>.tar.gz

  • umount /dev/cdrom

Where <xxxx> is the build/revision number of the VMware Workstation release.

Note: If you attempt to install a tar installation over an rpm installation — or the reverse — the installer detects the previous installation and must convert the installer database format before continuing.

5. Run the .tar VMware Tools installer:

  • cd vmware-tools-distrib

  • ./vmware-install.pl

Respond to the configuration questions on the screen. Press Enter to accept the default value.

6. Log off of the root account.

  • exit

7. Start X and your graphical environment

8. In an X terminal, launch the VMware Tools background application.

  • vmware-toolbox &

Note: You may run VMware Tools as root or as a normal user. To shrink virtual disks, you must run VMware Tools as root (su -).

Uninstalling VMware Tools


To remove VMware Tools from your Linux guest operating system, log on as root (su -) and enter the following command:
From a tar install


  • vmware-uninstall-tools.pl

From an RPM install


  • rpm -e VMwareTools

In PART 3 of this series, I'll show you how to ADD A EXTERNAL HDD TO CentOS AND THEN MOUNT IT !!

Best Practices- Installing CentOS VM on VMware Workstation- Part 1

Best Practices- Installing CentOS VM on



VMware Workstation



- Part 1


INSTALLING CentOS AS A VIRTUAL MACHINE


In this series of blogs I am going to share my experiences and few best practices when it comes to installing and configuring a LINUX, in this case, a CentOS VM using VMware Workstation 8.

NOTE that these steps can well be used to install any LINUX VM on vSphere platforms as well... just the tuning with respect to the class of OS changes then.. like Debian, or Red-Hat..

Software used in this tutorial:

We are going to create a TYPICAL Virtual Machine



Now there are two ways of installing a VM using VMware Workstation.. first; there is something called as Easy Install which assumes certain criteria for installing the OS and provides a quick way to complete the OS installation.. but i am going to avoid that and install the OS manually. In this way, i can specify the Partitioning tables for my CentOS as I want it.



Select Linux from the Guest OS Menu and CentOS 64-Bit as the Version from the drop down list as shown



Provide a suitable name for your VM.. i usually go with Defaults...



Specify 5 GB as the Disk Capacity.. we don't want to provide a lot of Disk unnecessarily.. 5 GB is enough for installing any LINUX OS.. We will show you how to attach a HDD to the VM in our PART 3 of the series..



Click Customize Hardware to mount the CentOS ISO File manually and do other bit of "cleaning up" !!



First of all, we do the "clean up".. just remove unwanted devices like Floppy Drives and Printers (Unless you want to use them for your self !!)



Click on CD-ROM (IDE 1) item, select Use ISO image option and click Browse button to select your recently downloaded *.iso installation file of CentOS as shown below



Once done, the VM is ready to be Powered ON. Select the Power On this Virtual Machine as shown below



When your virtual pc starts, you’ll see welcome screen of installation CentOS. Press ENTER to begin the Installation Process...



If you’ll not be able to see this screen, then restart your virtual machine and click Esc button for Boot menu. And from this menu, select CD-ROM Drive

Click ENTER. The installation will tell you to begin testing of your installation CD or DVD. Select Skip button. It will skip testing your CD media and save your time..



Then you’ll get another welcome screen, you only have to click next button on this screen



Select your language of installation and click Next



Then, select your keyboard configuration to use it for the system you’re installing and click Next



Then, you’ll be warned to create new partitions by erasing ALL DATA on your newly created hard drive. As there’s no information in this drive, you’ll select Yes



We will Create a Custom Layout as in this case we will be able to specify the partitions and provide them sizes and all :-)



We will first create a SWAP Partition. the size of the SWAP Partition depends on how much RAM is provided to the VM.. in this case, the VM is provided with 1 GB RAM.. hence we are providing SWAP 1000 MB..



Similarly, create a BOOT Partition of 100 MB...



You can provide the remaining 4000MB (approximately) to the ROOT (/) Partition as shown.. The ROOT partition houses the installation of your CentOS System..



After you have created the Partitions, it should look something like this:

NOTE: Three Partitions are created; namely, sda1, sda2 and sda3



You may get a warning saying you have allocated less SWAP space than available. You can ignore this message as anyways, SWAP is only used when the system is almost at crashing point.. :-)



You can create the GRUB BOOT Loader on the /dev/sda partitions. Leave this for default values and click NEXT



Then, you’ll see Network Configurations screen, don’t change anything and click next. You can change whatever you want after installation, for now, let it continue in this way and click Next



From this screen, select your region and click Next



Then, you’ll be prompted to enter password for root user, enter it and click Next



To install packages that you may want in your OS, you can select them Customizing your installation here. Select Customize now option and click Next



I am not a big fan of having all these extra services running on my VM.. so I simply remove what ever I don't require.. in this case, Games and Entertainment, Graphics, Office Suite etc are removed from Installation process.



Now, you’re ready for installation. Click next on this screen, the installation will begin



You’ll see how all packages are installing. After a while, your OS will be ready for use



After the installation is completed, click Reboot button to reboot your OS



After reboot, you’ll face with another Welcome screen. There are some steps need to be completed

Click Forward button on the screen.



Here, just disable your Firewall. Do remember that this is only for test purpose, don’t disable your Firewall on a real system! And click forward button



For testing purpose, it would be good to disable SELinux too :-)



If you need, make your Date and Time configuration and click Forward



If you want to create a new user, you can fill these blanks. You can pass this step too by clicking Forward button



Then Click Finish and the system will reboot



After reboot, CentOS will be opened and you’ll be prompted to enter username (root) and password (root’s password)


Your CentOS is ready to use! Congratulations !!


In the next article, I’m going to show installation of VMware-tools ..

Till then, keep VMware-ing !!!