1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
2 | <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
3 | <topic xml:lang="en-us" id="headless-vm-steps">
|
---|
4 | <title>Step by Step: Creating a Virtual Machine on a Headless Server</title>
|
---|
5 |
|
---|
6 | <body>
|
---|
7 | <p>The following instructions describe how to create a virtual machine on a headless server over a network
|
---|
8 | connection. This example creates a virtual machine, establishes an RDP connection and installs a guest operating
|
---|
9 | system. All of these tasks are done without having to touch the headless server. You need the following
|
---|
10 | prerequisites: </p>
|
---|
11 | <ul>
|
---|
12 | <li>
|
---|
13 | <p><ph conkeyref="vbox-conkeyref-phrases/product-name"/> on a server machine with a supported host operating
|
---|
14 | system. The <ph conkeyref="vbox-conkeyref-phrases/vbox-ext"/> for the VRDP server must be installed, see <xref
|
---|
15 | href="vrde.dita#vrde"/>. The procedures assume a Linux server is used. </p>
|
---|
16 | </li>
|
---|
17 | <li>
|
---|
18 | <p>An ISO file accessible from the server, containing the installation data for the guest operating system to
|
---|
19 | install. Windows XP is used in the example. </p>
|
---|
20 | </li>
|
---|
21 | <li>
|
---|
22 | <p>A terminal connection to that host through which you can access a command line, such as
|
---|
23 | <userinput>ssh</userinput>. </p>
|
---|
24 | </li>
|
---|
25 | <li>
|
---|
26 | <p>An RDP viewer on the remote client. See <xref href="rdp-viewers.dita#rdp-viewers"/> for examples. </p>
|
---|
27 | </li>
|
---|
28 | </ul>
|
---|
29 | <p>Note that on the server machine, since we will only use the headless server, Qt and the X Window system are not
|
---|
30 | required. </p>
|
---|
31 | <ol>
|
---|
32 | <li>
|
---|
33 | <p>On the headless server, create a new virtual machine. For example: </p>
|
---|
34 | <pre xml:space="preserve">VBoxManage createvm --name "Windows XP" --ostype WindowsXP --register</pre>
|
---|
35 | <p>If you do not specify <codeph>--register</codeph>, you will have to manually use the
|
---|
36 | <userinput>registervm</userinput> command later. </p>
|
---|
37 | <p>You do not need to specify <codeph>--ostype</codeph>, but doing so selects some sensible default values for
|
---|
38 | certain VM parameters. For example, the RAM size and the type of the virtual network device. To get a complete
|
---|
39 | list of supported operating systems you can use the following command: </p>
|
---|
40 | <pre xml:space="preserve">VBoxManage list ostypes</pre>
|
---|
41 | </li>
|
---|
42 | <li>
|
---|
43 | <p>Ensure the settings for the VM are appropriate for the guest operating system that we will install. For
|
---|
44 | example: </p>
|
---|
45 | <pre xml:space="preserve">VBoxManage modifyvm "Windows XP" --memory 256 --acpi on --boot1 dvd --nic1 nat</pre>
|
---|
46 | </li>
|
---|
47 | <li>
|
---|
48 | <p>Create a virtual hard disk for the VM. For example, to create a 10 GB virtual hard disk: </p>
|
---|
49 | <pre xml:space="preserve">VBoxManage createhd --filename "WinXP.vdi" --size 10000</pre>
|
---|
50 | </li>
|
---|
51 | <li>
|
---|
52 | <p>Add an IDE Controller to the new VM. For example: </p>
|
---|
53 | <pre xml:space="preserve">VBoxManage storagectl "Windows XP" --name "IDE Controller"
|
---|
54 | --add ide --controller PIIX4</pre>
|
---|
55 | </li>
|
---|
56 | <li>
|
---|
57 | <p>Set the VDI file you created as the first virtual hard disk of the new VM. For example: </p>
|
---|
58 | <pre xml:space="preserve">VBoxManage storageattach "Windows XP" --storagectl "IDE Controller"
|
---|
59 | --port 0 --device 0 --type hdd --medium "WinXP.vdi"</pre>
|
---|
60 | </li>
|
---|
61 | <li>
|
---|
62 | <p>Attach the ISO file that contains the operating system installation that you want to install later to the
|
---|
63 | virtual machine. This is done so that the VM can boot from it. </p>
|
---|
64 | <pre xml:space="preserve">VBoxManage storageattach "Windows XP" --storagectl "IDE Controller"
|
---|
65 | --port 0 --device 1 --type dvddrive --medium /full/path/to/iso.iso</pre>
|
---|
66 | </li>
|
---|
67 | <li>
|
---|
68 | <p>Enable the VirtualBox Remote Desktop Extension, the VRDP server, as follows: </p>
|
---|
69 | <pre xml:space="preserve">VBoxManage modifyvm "Windows XP" --vrde on</pre>
|
---|
70 | </li>
|
---|
71 | <li>
|
---|
72 | <p>Start the virtual machine using the <userinput>VBoxHeadless</userinput> command: </p>
|
---|
73 | <pre xml:space="preserve">VBoxHeadless --startvm "Windows XP"</pre>
|
---|
74 | <p>If the configuration steps worked, you should see a copyright notice. If you are returned to the command
|
---|
75 | line, then something did not work correctly. </p>
|
---|
76 | </li>
|
---|
77 | <li>
|
---|
78 | <p>On the client machine, start the RDP viewer and connect to the server. See <xref
|
---|
79 | href="rdp-viewers.dita#rdp-viewers"/> for details of how to use various common RDP viewers. </p>
|
---|
80 | <p>The installation routine of your guest operating system should be displayed in the RDP viewer. </p>
|
---|
81 | </li>
|
---|
82 | </ol>
|
---|
83 | </body>
|
---|
84 |
|
---|
85 | </topic>
|
---|