Creating Virtual Machines For Xen, KVM, VMware Workstation 6, and VMware Server With vmbuilder On Ubuntu 8.10 - Page 2
4.1 Create A Virtual Machine For KVMTo create a virtual machine for KVM, we could run the following command: cd ~/vm7/ Most of the options are self-explanatory. --part specifies the file with the partitioning details, relative to our working directory (that's why we had to go to our VM directory before running vmbuilder), --templates specifies the directory that holds the template file (again relative to our working directory), and --firstboot specifies the firstboot script. --libvirt=qemu:///system tells KVM to add this VM to the list of available virtual machines. --addpkg allows you to specify Ubuntu packages that you want to have installed during the VM creation (see above why you shouldn't add openssh-server to that list and use the firstboot script instead). In the --mirror line I have specified my local apt-proxy mirror (http://192.168.0.100:9999/ubuntu) - I have used my publically accessible IP address instead of localhost or 127.0.0.1 because this mirror will be used in the VM's /etc/apt/sources.list file as well, and of course, the VM won't be able to connect to 127.0.0.1 on the host. Of course, you can as well specify an official Ubuntu repository in --mirror, e.g. http://de.archive.ubuntu.com/ubuntu. If you leave out --mirror, then the default Ubuntu repository (http://archive.ubuntu.com/ubuntu) will be used. Don't specify an apt-proxy mirror if you intend to transfer the VM to a host that has no access to the apt-proxy mirror (e.g. because it's in a different network) - as I've already mentioned, the VM will use the mirror in its /etc/apt/sources.list that you specify for the vmbuilder command. This will create an ubuntu-kvm/ subdirectory within the ~/vm7 directory that contains the disk image of the virtual machine: ls -l ubuntu-kvm/ root@server1:~/vm7# ls -l ubuntu-kvm/ The configuration file of the VM is located in the /etc/libvirt/qemu directory (/etc/libvirt/qemu/vm7.xml): ls -l /etc/libvirt/qemu root@server1:~/vm7# ls -l /etc/libvirt/qemu If you want to transfer the VM to another host, copy the ubuntu-kvm directory and the VM's configuration file to the new host (e.g. using scp).
4.2 Create A Virtual Machine For XenThe command to create a Xen VM is similar to the KVM command: cd ~/vm7/ This will create an ubuntu-xen/ subdirectory within the ~/vm7 directory that contains the disk image of the virtual machine and its Xen configuration file: ls -l ubuntu-xen/ root@server1:~/vm7# ls -l ubuntu-xen/ If you want to transfer the VM to another host, copy the ubuntu-xen directory to the new host (e.g. using scp). You should place the Xen configuration file in the /etc/xen directory.
4.3 Create A Virtual Machine For VMware Workstation 6The command to create a VM for VMware Workstation 6 is similar to the KVM command: cd ~/vm7/ This will create an ubuntu-vmw6/ subdirectory within the ~/vm7 directory that contains the disk image of the virtual machine and its configuration file: ls -l ubuntu-vmw6/ root@server1:~/vm7# ls -l ubuntu-vmw6/ If you want to transfer the VM to another host, copy the ubuntu-vmw6 directory to the new host (e.g. using scp).
4.4 Create A Virtual Machine For VMware ServerThe command to create a VM for VMware Server is similar to the KVM command: cd ~/vm7/ This will create an ubuntu-vmserver/ subdirectory within the ~/vm7 directory that contains the disk image of the virtual machine and its configuration file: ls -l ubuntu-vmserver/ root@server1:~/vm7# ls -l ubuntu-vmserver/ If you want to transfer the VM to another host, copy the ubuntu-vmserver directory to the new host (e.g. using scp).
5 Links
|



Recent comments
8 hours 35 min ago
13 hours 40 min ago
18 hours 5 min ago
19 hours 53 min ago
1 day 10 hours ago
1 day 10 hours ago
1 day 15 hours ago
1 day 21 hours ago
1 day 22 hours ago
1 day 23 hours ago