Installing Xen On An Ubuntu 8.04 (Hardy Heron) Server From The Ubuntu Repositories - Page 2
3 Creating Virtual Machines (domU)Now let's create our first guest domain, xen1.example.com, running Hardy Heron (hardy) with the IP address 192.168.0.101: xen-create-image --hostname=xen1.example.com --size=2Gb --swap=256Mb --ide \ A lot of switches are unnecessary here because we specified the same details in /etc/xen-tools/xen-tools.conf but it shows that you can specify the desired settings either on the command line or in /etc/xen-tools/xen-tools.conf. Please make sure that you specify --ide, otherwise your virtual machine might not boot! (To learn more about the available options, take a look at the xen-create-image man page: man xen-create-image ) The xen-create-image command will now create the xen1.example.com virtual machine for us. This can take a few minutes. The output should be similar to this one: root@server1:~# xen-create-image --hostname=xen1.example.com --size=2Gb --swap=256Mb --ide \ There should now be a xen1.example.com configuration file - /etc/xen/xen1.example.com.cfg. Take a look at it to become familiar with virtual machine configuration files: cat /etc/xen/xen1.example.com.cfg
The file: parameter is now deprecated in Xen 3.2, therefore we must edit /etc/xen/xen1.example.com.cfg now and replace file: with tap:aio: (otherwise you'll get an error similar to this one: Error: Device 769 (vbd) could not be connected. losetup /dev/loop0 /home/xen/domains/xen1.example.com/swap.img failed when you try to start a vm - see http://ubuntuforums.org/showthread.php?t=770902 as well): vi /etc/xen/xen1.example.com.cfg
(Please note: if you have a dual-core CPU and want the virtual machine to use both CPU cores, please add the line vcpus = '2' to the configuration file, like this: vi /etc/xen/xen1.example.com.cfg
Afterwards, in the virtual machine, you can run the command cat /proc/cpuinfo to check that both CPU cores are being used by the virtual machine. The output could look like this if your vm is using both cores: xen1:~# cat /proc/cpuinfo ) To start the virtual machine, run xm create /etc/xen/xen1.example.com.cfg Run xm console xen1.example.com to log in on that virtual machine (type CTRL+] if you are at the console, or CTRL+5 if you're using PuTTY to go back to dom0), or use an SSH client to connect to it (192.168.0.101). In the virtual machine (when you use it for the first time), run mv /lib/tls /lib/tls.disabled Now back to the host system (dom0). To get a list of running virtual machines, type xm list The output should look like this: root@server1:~# xm list To shut down xen1.example.com, do this: xm shutdown xen1.example.com If you want vm01 to start automatically at the next boot of the system, then do this: ln -s /etc/xen/xen1.example.com.cfg /etc/xen/auto Here are the most important Xen commands: xm create -c /path/to/config - Start a virtual machine. Let's create a second vm, xen2.example.com with the IP address 192.168.0.102: xen-create-image --hostname=xen2.example.com --size=2Gb --swap=256Mb --ide \ Then open the configuration file of the vm, /etc/xen/xen2.example.com.cfg, and replace file: with tap:aio: again: vi /etc/xen/xen2.example.com.cfg
Afterwards, you can start xen2.example.com like this: xm create /etc/xen/xen2.example.com.cfg (Don't forget to run xm console xen2.example.com and mv /lib/tls /lib/tls.disabled when you're in the vm for the first time!) ... and shut it down like this: xm shutdown xen2.example.com A list of all virtual machines that were created with the xen-create-image command is available under xen-list-images root@server1:~# xen-list-images Name: xen2.example.com To learn more about what you can do with xen-tools, take a look at this tutorial: http://www.howtoforge.com/xen_tools_xen_shell_argo
4 Links
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
One number. one voicemail. Seize the lead with Sprint. Learn more
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning
Learn benefits of Simpana software.
View the Gartner Video
Sprint 4G - The Ultimate Mobile Broadband
Click here
SAP-Business Objects Crystal Reports Server
Complete reporting without hidden costs. Free Trial




print: 

Recent comments
12 hours 23 min ago
14 hours 2 min ago
1 day 2 hours ago
1 day 4 hours ago
1 day 12 hours ago
1 day 16 hours ago
1 day 21 hours ago
1 day 23 hours ago
3 days 4 hours ago
3 days 4 hours ago