Skip to content

linux - 2. page

How to install KVM & the Kimchi graphical web interface on Ubuntu 15.04

KVM is an excellent virtualization engine, but it lacks an easy to use user interface. Kimchi changes that. Kimchi allows you to handle the basic management tasks, like creating, starting and stopping virtual machines, adding iSCSI targets, NFS shares, and so much more. The interface is beautiful and it’s pretty easy to set up. Today, I’ll show you how.

Note: Kimchi requires systemd, so Ubuntu 14.04 LTS will NOT work. You might be able to use 14.10, if systemd is installed. I am using Ubuntu 15.04 for this guide, which uses systemd by default.

How to install KVM on Ubuntu 15.04

First, let’s make sure everything is updated and upgraded. I’m working with a minimal installation of Ubuntu 15.04, with only OpenSSH server installed.

#  sudo apt-get update

#  sudo apt-get upgrade

Now, lets install KVM, and all the dependencies needed for Kimchi.

#  sudo apt-get install gcc make autoconf automake gettext git \
python-cherrypy3 python-cheetah python-libvirt libvirt-bin \
python-imaging python-pam python-m2crypto python-jsonschema \
qemu-kvm libtool python-psutil python-ethtool sosreport \
python-ipaddr python-ldap python-lxml nfs-common open-iscsi \
lvm2 xsltproc python-parted nginx firewalld python-guestfs \
libguestfs-tools python-requests websockify novnc spice-html5 \
wget unzip

At some point during the installation, a postfix configuration window will appear. Unless you have a reason to do otherwise, I suggest you select “Local only.”

Screen Shot 2015-06-04 at 11.55.09 AM

Click Here To Read The Rest!

How To Install VMware VMtools (VMware Tools) on Ubuntu Linux

So, you need to install vmtools on Ubuntu. You’ve come to the right place. I’ve done it hundreds of times, but recently a friend of mine was having some difficulty doing this. I thought I would put a quick how-to together so I could maybe help some more people out. Here goes.

How To Install VMtools on Ubuntu

First thing’s first. Before going any further, I suggest you update apt, and then upgrade. This will make sure everything is up to date on your virtual machine.

#  sudo apt-get -y update

#  sudo apt-get -y upgrade

Now, you need to attach the VMware tools installation disc to your virtual machine. In ESXi / vSphere, just right click on the virtual machine, in the left pane, go to Guest, then select “Install/Upgrade VMware Tools.” Like this.

Screen Shot 2015-05-17 at 3.43.46 PM

If you are using VMware Workstation, or VMware Fusion, select the virtual machine in the library, then under the Virtual Machine pull down menu at the top, select “Install VMware Tools.” In VMware Fusion, it looks like this.

Click Here To Read The Entire Tutorial!

Linux Basics Series – #1 – Creating User Accounts and Managing Groups In Linux

This is the first part in a series on LInux Basics. Today, I’m going to give you a brief run-down on creating user accounts and creating groups from the linux command line. These aren’t difficult tasks, but often times it’s good to refresh the basics and have a reference to go back to. So, here we go.

How to add a user account

Creating a user account is a very straight forward process and nearly identical for all Linux distributions.

#  useradd username

Some distributions, such as Ubuntu, might have the root account disabled. If so, you will need to use sudo to gain root privileges to run a specific command. If you get a permission denied error, simply run this command instead.

#  sudo useradd username

How to set or change a password

Once you’ve created a user account, you will need to set a password. To do so, use the passwd command.

#  passwd username
Enter new UNIX password:
Retype new UNIX password:

or

#  sudo passwd username
Enter new UNIX password:
Retype new UNIX password:

How to create a new group

Click Here To Read The Entire Tutorial!

How To Figure Out What Distribution & Version Of Linux Is Installed and Running

I’ve often found myself picking up on a server build, taking over administration, or troubleshooting problems on Linux based OS’s, with absolutely no clue as to what distribution of Linux is running on said machine. The distribution dictates what package manager is used, such as yum for CentOS / RHEL, and apt (aptitude) for Debian and Ubuntu based distributions. So, if you’re working on a Linux machine and you want to figure out exactly what you’re working with, there are some basic commands you can run that will tell you precisely that.

To find out what distribution is installed

There is always a file in /etc called something-release. This file will give you the basic info you need. So, using cat, we can figure out exactly what distribution is installed by running this.

#  cat /etc/*-release

Here is an example of what you can expect to see on an Ubuntu 14.04 server.

Screen Shot 2015-05-16 at 12.48.13 PM

As you can see, this gives you quite a bit of information to work with. All the way down to the release version and codename designation, as well as the root os base, which is Debian in the case of Ubuntu. Now, lets see what this looks like on another distribution, such as CentOS.

Click Here To Read The Entire Tutorial!

How To Disable Firewalld and Get Old School IPTables Back In CentOS 7 and RHEL 7

When CentOS 7 was released, it was quickly obvious that CentOS and Red Hat had switched over to firewalld for its firewall control. Although its syntax is a bit easier to work with than iptables, some software out there has issues with it, such as Docker. Some just prefer to stick with the standard iptables syntax because it is what they know and what they are comfortable with. So, if you have CentOS 7 or RHEL 7 installed and want the old iptables back, this guide is for you.

First thing’s first, disable firewalld

#  systemctl mask firewalld

Now, lets stop firewalld

#  systemctl stop firewalld

It would be a good idea to go ahead and make sure that firewalld is masked and inactive, so lets do just that.

#  systemctl status firewalld

firewalld.service
   Loaded: masked (/dev/null)
   Active: inactive (dead)

Click Here to Read The Entire Tutorial!

How to Run Bandwidth Speed Tests From the Linux Command Line With Speedtest.net

Believe it or not, there is a way to use Speedtest.net’s speed test service from a Linux command line. Usually, one would fire up a web browser and just go to Speedtest.net and the flash utility would load. Obviously, this is impossible from a command line. If you have a cloud instance or virtual private server (VPS), you don’t have a gui or a web browser. So, here is how to run an Internet speed test from the Linux command line.

To achieve this, there is a package called speedtest-cli. It is a python based utility that more or less has the same functionality as the gui. When ran with defaults, it will locate the closest server and run a download test, then an upload test, and display the results when it’s finished. You can do this by running:

#  wget -O - https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py | python

After the script downloads and runs, you’ll see something like this:

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from AT&T U-verse (108.238.104.79)...
Selecting best server based on latency...
Hosted by TekLinks (Birmingham, AL) [103.61 km]: 30.383 ms
Testing download speed........................................
Download: 98.96 Mbit/s
Testing upload speed..................................................
Upload: 56.06 Mbit/s

Personally, I like to select a specific server from a specific location when I run a speed test. I’ve found that the closest server, isn’t always the fastest. Just because a speed test server is located a couple hundred miles from you, it does not mean the path to it is linear, and it doesn’t mean their connection is fast enough to saturate your own. Not to worry, you can also select a server to your liking. There are two ways to approach this. You can either install the speedtest-cli package using your package manager, or you can download the script manually. I’ll cover both.

To install the speedtest-cli package on Ubuntu

#  sudo apt-get install speedtest-cli

After installing the package, you can simply run:

#  speedtest-cli

Now, if you’re using a distribution other than Ubuntu, or do not wish to install the package, you can simply download the script. To do that, do the following:

#  wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py

#  chmod +x speedtest_cli.py

The chmod command gives execute permission to the file. This is required to run it. Once you have downloaded the script, you can run it by doing this:

#  ./speedtest_cli

There are quite a few options you can use with the script. I’ll go over the few that I have used. First up is –share. This option gives you a web link to share you speed test results with others. You’ve probably seen the little png boxes before. They look like this:

speed test results

So to get a nice automatically generated results picture like this, just run this command:

#  ./speedtest_cli.py --share

or

#  speedtest-cli --share

It will run the speed test like normal, but the very last line will have a link to your results. Now, like I was saying earlier, I like to specify the server the speed test runs against. To do that you first need to know the ID of the server you want to use. To get a list of speed test servers available, and their ID, run this command:

#  ./speedtest_cli.py --list | more

or

#  speedtest-cli --list | more

My favorite servers ID is 3595, so I’ll use it in my example. Once you have the ID of the server you want to use, all you need to do is specify it with the –server option. Be sure to swap out 3595 with the ID of your prefered server. Like this:

#  ./speedtest_cli.py --server 3595

or

#  speedtest-cli --server 3595

There are some other pretty cool options available if you want to play around some more. You can display values in Bytes instead of Bits, use the URL of a Speedtest Mini server, and even select the source IP you want to bind to. If you want to check out the other options available, run this command.

#  ./speedtest_cli.py --help

or

#  speedtest-cli --help

That’s all there is to it. If you run into any troubles feel free to ask for help in the comments below. Thanks!

Simple Method to Benchmark Disk Read & Write Speeds From the Linux Command Line

Recently, I’ve been exploring high availability iSCSI targets and using them as virtual machine storage. I have always been a bit weary of iSCSI performance over gigabit networks due to some not-so-great experiences many years ago. iSCSI technology has progressed quite a bit since then. FreeNAS has an excellent implementation of iSCSI, as well as Nexenta. I wanted to get a good grasp on how well everything was performing, so I decided to run some basic benchmarks.

The virtual machine I’m working with has Ubuntu 15.04 installed, but these commands will work on just about any linux distribution in existence. The hyperviser is running VMware ESXi 6, with this particular virtual machine stored on an iSCSI target served from a FreeNAS virtual machine running on another VMware ESXi hyperviser. The FreeNAS virtual machine has been given PCI Passthrough to a 3ware 9650SE-16ML, connected to 4x1TB Hitachi SATA Hard Drives exported as JBOD (individual drives, no RAID). FreeNAS configured a RAID10 with the four drives, which is where the iSCSI target resides. The network is gigabit, with an Adtran NetVanta 1524ST switch. I have not enabled Jumbo Frames. The theoretical maximum transfer speed on a gigabit network is about 125MB/s. Of course, with the overhead associated with TCP/IP and iSCSI encapsulation, a single link should be a little less. Lets get started.

To test WRITE speed of hard disk using the DD command:

#  sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 10.8496 s, 99.0 MB/s

So, this command writes a bunch of zeros to a file called tempfile, with a size of 1024MB. If you want to use a larger test file, you can change “1024” to a higher number. For instance, changing 1024 to 10000 would write a 10GB temp file. This command only tests the write speed. As you can see, the reported write speed was 99MB/s, not too shabby.

Click here to view the entire tutorial