Xen Systems Administration for Users


This document is designed for end users. In many cases, a systems administrator will install the Xen virutalization system on a server which allows for greater maintenance and recovery in the future. However, the clients who own those machines may not know the basic actions they can take without resorting contacting a system administrator.

These actions require you to have an administrative account on the server in question. When you are logged in as an administrator, you must be very cautious to only perform the commands which you know the results of. As an administrator on a Unix machine, it is quite possible to irretrievably destroy data. Be very careful.

Logging in: you should have a user name and password. When you log in with this user name, you will have limited rights on the system. To perform work at a higher level, you must elevate your permissions to the administrative account named root. You should never log into a Unix system as the root user unless you are an experienced systems administrator. The following commands assume the sudo command exists on your system. The sudo command allows you to temporarily elevate your permissions to the root user on a per-command basis.

First, log into the system as your user. If nothing is displayed on your screen, press the Ctrl key a couple of times (this just wakes up the display). You should see a screen as follows:

Debian GNU/Linux 6.0 xen hvc0
xen login:

Your display will definitely be different; the important thing is the word login followed by a colon. In particular, your computer's name will be different (this one is called “xen”). Type your user name and it should appear after the colon. Your user name is, in almost all cases, all lower case. Press the Enter key after typing in your user name and a new line will pop up asking for your password. As you type, nothing will appear on the screen, but your password is being recorded. Press the Enter key after you have typed your password.

Debian GNU/Linux 6.0 xen hvc0
xen login: myusername Password: nothing shows up while you type here

When you press the enter key (after typing the password), some information will be displayed on the screen similar to the following

Last login: Mon Dec 24 23:01:13 CST 2012 on hvc0
Linux xen 2.6.32-5-xen-amd64 #1 SMP Sun May 6 08:57:29 UTC 2012 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law. myusername@xen:~$

At the end, you will have a flashing cursor after the last line. The server is now waiting for your new command. All commands are executed when you press the Enter key after typing them in.

Following is an example of a full login:

Debian GNU/Linux 6.0 xen hvc0
xen login: myusername Password: nothing shows up while you type here
Last login: Mon Dec 24 23:01:13 CST 2012 on hvc0
Linux xen 2.6.32-5-xen-amd64 #1 SMP Sun May 6 08:57:29 UTC 2012 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law. myusername@xen:~$

At this point, you can begin executing commands. Following are a list of the commands most useful to end users.

sudo xm list Lists all running virtual servers. NOTE: The one named Domain-0 is the main virtual server, ie the one you are normally logged into
sudo xm console virtualname Attaches the “console” to the virtual server. You will be at the login screen for the virtual server at this point. If you see nothing, press the Enter key a few times until you see a login prompt, similar to the one you saw when you logged into the main server. When you do, log in normally. To exit from this console, press the special key combination Ctrl-], that is, press and hold the Control key (Ctrl) and, while the Control key is down, press the left square bracket. You should log out first (see below).
exit This will leave whatever console you are in and return you to a login prompt. If you are logged into a console (sudo xm console above), it will exit the console for the virtual. You should always do this before using the Ctrl-] command. This is also the last command you use when you are through with the server. You should never leave a terminal logged in on a server. Always type exit as many times as necessary to get back to a login prompt.
sudo xm reboot virtualname This will reboot a virtual machine nicely. It will shut it down, then start it back up. It is a combination of sudo xm shutdown and sudo xm create
sudo xm shutdown virtualname Will shut down a virtual server. The prompt returns very fast, but the virtual will take however long is necessary to shut down nicely

cd /etc/xen

ls *.cfg

sudo xm create configurationfile -c

These commands will start up the virtual defined by the configuration file. It is three commands: cd /etc/xen – changes you into the virtual server configuration directory (folder) ls *.cfg – lists all virtual configuration files (in many cases, only one is defined) sudo xm create configurationfile -c – configurationfile is one of the list shown in the previous command. You must type the configuration file name exactly. If you add the -c at the end, you will be immediately attached to the console of the virtual as it is booting up (and must press Ctrl-] to exit).
sudo xm top

changes the screen to allow you to watch statistics on all running virtuals. On smaller terminals, the lines may wrap. One use for this is when you have executed a sudo xm shutdown or sudo xm reboot, in which case you can then run sudo xm top to watch as the virtual shuts down (and possibly start back up again).

 

 

 

 

Last update:
2012-12-31 06:40
Author:
Rod
Revision:
1.3
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.