• VMware

    Learn about VMware virtualization for its products like vsphere, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • You don't have to be a genius or a visionary or even a college graduate to be successful. You just need a framework and a dream!!!

    Saturday, July 26, 2014

    How to take remote desktop of Windows from Linux

    In Linux we have a utility rdesktop which is used to take remote to any Windows machine. let us see how it works and the iptable rules to allow or reject the same.

    You need to install rdesktop package for this purpose. For RHEL machine you can use the below command

    To check for existing package
    # rpm -qa | grep rdesktop
    To install a new package
    # yum -y install rdesktop
    Once the package is installed run the below command from the GUI console of your Linux box
    NOTE: rdesktop will only work from GUI console and not from CLI or putty

    Syntax
    # rdesktop (machine_name_to_connect)
    # rdesktop 192.168.1.7

    And this should do the magic.

    In case you get any graphical console related error follow the below link
    Xlib: No protocol specified

    Iptables rules for rdesktop


    To allow a particular subnet to which your machine can connect
    # iptables -I OUTPUT -d 192.168.1.0/24 -p tcp --dport 3289 -j ACCEPT
    To block a subnet to which your machine can connect
    # iptables -I OUTPUT -d 192.168.1.0/24 -p tcp --dport 3289 -j REJECT

    Related Articles:
    Iptables rules to allow/block ssh incoming/outgoing connection in Linux
    Iptables rules to block/allow icmp ping request in Linux


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    Step by Step Linux Boot Process Explained In Detail
    What is the difference between ext3 and ext4 filesystem in Linux ?
    How to configure Private Network in VMware Workstation
    9 examples to help you understand top command usage in Unix/Linux
    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    Understanding Load Average in Linux and when to be worried about it?
    Disk Attachment Technology FC vs SAS vs iSCSI
    Understanding UMASK value in Linux
    How to keep a track of all the commands run by any user in Linux
    How do you check Linux machine is Physical or Virtual remotely?
    RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail

    Thursday, July 24, 2014

    How to detect new hard disk attached without rebooting in Linux

    Scenario:

    Suppose you have added a new hard disk to your Linux OS running on any Virtual Environment which in my case is VMware workstation. Once added the new hard drive, generally the changes won't reflect unless you reboot the Guest OS.

    But what if you are in no position to reboot the Gues Linux OS?

    Solution:

    In the below path you can find a list of host symlinks pointing to the iscsi device configured on your Linux box
    # ls -l /sys/class/scsi_host/
    total 0
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host0 -> ../../devices/pci0000:00/0000:00:07.1/host0/scsi_host/host0
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host1 -> ../../devices/pci0000:00/0000:00:07.1/host1/scsi_host/host1
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host10 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host10/scsi_host/host10
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host2 -> ../../devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host3 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host3/scsi_host/host3
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host4 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host4/scsi_host/host4
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host5 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host5/scsi_host/host5
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host6 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host6/scsi_host/host6
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host7 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host7/scsi_host/host7
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host8 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host8/scsi_host/host8
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host9 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host9/scsi_host/host9

    But to detect a new hard drive attached you need to first get your host bus number used which you can get by using below command
    # grep mpt /sys/class/scsi_host/host?/proc_name
    You should get a output like below
    /sys/class/scsi_host/host2/proc_name:mptspi
    So as you see your host2 is the relevant fiels where you need to reset the storage buffer values. Run the below command
    # echo "- - -" > /sys/class/scsi_host/host2/scan
    Here "- - -" defines the three values stored inside host*/scan i.e. channel number, SCSI target ID, and LUN values. We are simply replacing the values with wild cards so that it can detect new changes attached to the Linux box. This procedure will add LUNs, but not remove them.

    Once done verify if you can see the new hard drive which in my case worked very fine as I see below
    # fdisk -l
    Disk
    /dev/sdb: 3221 MB, 3221225472 bytes
    255 heads, 63 sectors/track, 391 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Let me know your success and failures.

    Related Articles:
    How to extend/resize Logical Volume and Volume Group in Linux
    How to detect new NIC/Ethernet card without rebooting in Linux
    How do you check Linux machine is Physical or Virtual remotely?


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    Step by Step Linux Boot Process Explained In Detail
    What is the difference between ext3 and ext4 filesystem in Linux ?
    How to configure Private Network in VMware Workstation
    9 examples to help you understand top command usage in Unix/Linux
    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    Understanding Load Average in Linux and when to be worried about it?
    Disk Attachment Technology FC vs SAS vs iSCSI
    Understanding UMASK value in Linux
    How to keep a track of all the commands run by any user in Linux
    How do you check Linux machine is Physical or Virtual remotely?
    RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail

    Wednesday, July 23, 2014

    How to detect new NIC/Ethernet card without rebooting in Linux

    I have a Red Hat 6 vm created in my VMware Workstation Lab. I will just go ahead and add a new NIC card to my running RHEL machine.

    Now let us try to detect it without rebooting the OS

    If we check the output of ifconfig
    # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:B9:4D:D3
              inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb9:4dd3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:91992 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58283 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:99437002 (94.8 MiB)  TX bytes:5498693 (5.2 MiB)

    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:2964 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2964 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:388592 (379.4 KiB)  TX bytes:388592 (379.4 KiB)

    So as of now the new thernet card configuration is not reflected. There is a file /etc/udev/rules.d/70-persistent-net.rules which contains details about the connected ethernet card in your RHEL box.

    I have discussed about the working of this file in the below link
    device eth0 does not seem to be present, delaying initialization

    In this file you can view the details of the newly connected Ethernet Card
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="
    00:0c:29:b9:4d:d3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b9:4d:dd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

    As you see it shows two ethernet card details i.e. eth0 and eth1. As of now eth0 is already in connected state as per the output of ifconfig which can also match using the MAC details. So let us manually create a new configuration file for the new card.
    # cd /etc/sysconfig/network-scripts
    To skip the hard work let us copy the contents from eth0 to our new file, in that way we will just have to make required changes
    # cp ifcfg-eth0 ifcfg-eth1
    Lines marked in blue are the one you need to change as per your environment
    # vi ifcfg-eth1
    DEVICE=eth1
    TYPE=Ethernet
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=none
    HWADDR=00:0c:29:b9:4d:dd
    IPADDR=192.168.1.5
    PREFIX=24
    GATEWAY=192.168.1.1
    DNS1=8.8.8.8

    DEFROUTE=yes
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    NAME="System eth1"

    Restart your network services
    # service network restart
    Shutting down interface eth0:                              
    [  OK  ]
    Shutting down loopback interface:                          [  OK  ]
    Bringing up loopback interface:                            [  OK  ]
    Bringing up interface eth0:  Determining if ip address 192.168.1.11 is already in use for device eth0...
                                                               [  OK  ]
    Bringing up interface eth1:  Determining if ip address 192.168.1.5 is already in use for device eth1...
                                                               [  OK  ]

    Verify your results
    # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:B9:4D:D3
              inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb9:4dd3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:92368 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58550 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:99470396 (94.8 MiB)  TX bytes:5531059 (5.2 MiB)

    eth1      Link encap:Ethernet  HWaddr 00:0C:29:B9:4D:DD
              inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb9:4ddd/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3 errors:0 dropped:0 overruns:0 frame:0
              TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:372 (372.0 b)  TX bytes:636 (636.0 b)


    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:2964 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2964 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:388592 (379.4 KiB)  TX bytes:388592 (379.4 KiB)

    I hope that was helpful. Let me know your success and failures

    Related Articles
    Creating an internal network using VMware Workstation
    How to do Ethernet/NIC bonding/teaming in Red Hat Linux
    How to configure network in Red Hat Linux
    Configure network in Solaris 10


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    Step by Step Linux Boot Process Explained In Detail
    What is the difference between ext3 and ext4 filesystem in Linux ?
    How to configure Private Network in VMware Workstation
    9 examples to help you understand top command usage in Unix/Linux
    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    Understanding Load Average in Linux and when to be worried about it?
    Disk Attachment Technology FC vs SAS vs iSCSI
    Understanding UMASK value in Linux
    How to keep a track of all the commands run by any user in Linux
    How do you check Linux machine is Physical or Virtual remotely?
    RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail

    Sunday, July 13, 2014

    Interview Questions on VMware ESXi with Answers

    1. What is a Hypervisor?
    It is a program that allows multiple operating systems to share a single hardware host. Each operating system appears to have the host's processor, memory, and other resources all to itself. However, the hypervisor is actually controlling the host processor and resources, allocating what is needed to each operating system in turn and making sure that the guest operating systems (called virtual machines) cannot disrupt each other.

    2. What is the hardware version used in VMware ESXi 5.5?
    Version 10

    Below is the table showing the different version of hardware used in different VMware products along with their release version
    Virtual Hardware Version
    Products
    10
    ESXi 5.5, Fusion 6.x, Workstation 10.x, Player 6.x
    9
    ESXi 5.1, Fusion 5.x, Workstation 9.x, Player 5.x
    8
    ESXi 5.0, Fusion 4.x, Workstation 8.x, Player 4.x
    7
    ESXi/ESX 4.x, Fusion 2.x/3.x Workstation 6.5.x/7.x,Player 3.x
    6
    Workstation 6.0.x
    4
    ACE 2.x, ESX 3.x, Fusion 1.x, Player 2.x
    3 and 4
    ACE 1.x, Player 1.x, Server 1.x, Workstation 5.x, Workstation 4.x
    3
    ESX 2.x, GSX Server 3.x

    Minimum H/W requirements for VMware vCenter Server 4.x and 5.x

    VMware vCenter Server 4.x


    Hardware
    Requirement
    Processor
    Intel or AMD x86 (64-bit if installing vCenter Server 4.1) processor with two or more logical cores, each with a speed of 2GHz.
    Memory
    3GB RAM. RAM requirements may be higher if your database runs on the same machine. VMware VirtualCenter Management WebServices requires 128Mb to 1.5GB of memory which is allocated at startup.
    Disk storage
    2GB. Disk requirements may be higher if your database runs on the same machine.
    Microsoft SQL Server 2005 Express requires up to 2GB free disk space to decompress the installation archive.
    Networking
    1Gbit recommended

    VMware vCenter Server 5.x

    vSphere 5.1 introduced the vCenter Single Sign-On (SSO) component as part of the vCenter Server management infrastructure. This change affects vCenter Server installation. Authentication by vCenter Single Sign-On makes the VMware cloud infrastructure platform more secure by allowing the vSphere software components to communicate with each other through a secure token exchange mechanism.