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>
|
---|
8 | The following instructions describe how to create a virtual
|
---|
9 | machine on a headless server over a network connection. This
|
---|
10 | example creates a virtual machine, establishes an RDP connection
|
---|
11 | and installs a guest operating system. All of these tasks are
|
---|
12 | done without having to touch the headless server. You need the
|
---|
13 | following prerequisites:
|
---|
14 | </p>
|
---|
15 | <ul>
|
---|
16 | <li>
|
---|
17 | <p>
|
---|
18 | <ph conkeyref="vbox-conkeyref-phrases/product-name"/> on a server machine with a supported host
|
---|
19 | operating system. The <ph conkeyref="vbox-conkeyref-phrases/vbox-ext"/> for the
|
---|
20 | VRDP server must be installed, see <xref href="vrde.dita#vrde"/>.
|
---|
21 | The procedures assume a Linux server is used.
|
---|
22 | </p>
|
---|
23 | </li>
|
---|
24 | <li>
|
---|
25 | <p>
|
---|
26 | An ISO file accessible from the server, containing the
|
---|
27 | installation data for the guest operating system to install.
|
---|
28 | Windows XP is used in the example.
|
---|
29 | </p>
|
---|
30 | </li>
|
---|
31 | <li>
|
---|
32 | <p>
|
---|
33 | A terminal connection to that host through which you can
|
---|
34 | access a command line, such as <userinput>ssh</userinput>.
|
---|
35 | </p>
|
---|
36 | </li>
|
---|
37 | <li>
|
---|
38 | <p>
|
---|
39 | An RDP viewer on the remote client. See
|
---|
40 | <xref href="rdp-viewers.dita#rdp-viewers"/> for examples.
|
---|
41 | </p>
|
---|
42 | </li>
|
---|
43 | </ul>
|
---|
44 | <p>
|
---|
45 | Note that on the server machine, since we will only use the
|
---|
46 | headless server, Qt and the X Window system are not required.
|
---|
47 | </p>
|
---|
48 | <ol>
|
---|
49 | <li>
|
---|
50 | <p>
|
---|
51 | On the headless server, create a new virtual machine. For
|
---|
52 | example:
|
---|
53 | </p>
|
---|
54 | <pre xml:space="preserve">VBoxManage createvm --name "Windows XP" --ostype WindowsXP --register</pre>
|
---|
55 | <p>
|
---|
56 | If you do not specify <codeph>--register</codeph>, you will
|
---|
57 | have to manually use the <userinput>registervm</userinput>
|
---|
58 | command later.
|
---|
59 | </p>
|
---|
60 | <p>
|
---|
61 | You do not need to specify <codeph>--ostype</codeph>, but
|
---|
62 | doing so selects some sensible default values for certain VM
|
---|
63 | parameters. For example, the RAM size and the type of the
|
---|
64 | virtual network device. To get a complete list of supported
|
---|
65 | operating systems you can use the following command:
|
---|
66 | </p>
|
---|
67 | <pre xml:space="preserve">VBoxManage list ostypes</pre>
|
---|
68 | </li>
|
---|
69 | <li>
|
---|
70 | <p> Ensure the settings for the VM are appropriate for the guest operating system that we
|
---|
71 | will install. For example: </p>
|
---|
72 | <pre xml:space="preserve">VBoxManage modifyvm "Windows XP" --memory 256 --acpi on --boot1 dvd --nic1 nat</pre>
|
---|
73 | </li>
|
---|
74 | <li>
|
---|
75 | <p>
|
---|
76 | Create a virtual hard disk for the VM. For example, to
|
---|
77 | create a 10 GB virtual hard disk:
|
---|
78 | </p>
|
---|
79 | <pre xml:space="preserve">VBoxManage createhd --filename "WinXP.vdi" --size 10000</pre>
|
---|
80 | </li>
|
---|
81 | <li>
|
---|
82 | <p>
|
---|
83 | Add an IDE Controller to the new VM. For example:
|
---|
84 | </p>
|
---|
85 | <pre xml:space="preserve">VBoxManage storagectl "Windows XP" --name "IDE Controller"
|
---|
86 | --add ide --controller PIIX4</pre>
|
---|
87 | </li>
|
---|
88 | <li>
|
---|
89 | <p>
|
---|
90 | Set the VDI file you created as the first virtual hard disk
|
---|
91 | of the new VM. For example:
|
---|
92 | </p>
|
---|
93 | <pre xml:space="preserve">VBoxManage storageattach "Windows XP" --storagectl "IDE Controller"
|
---|
94 | --port 0 --device 0 --type hdd --medium "WinXP.vdi"</pre>
|
---|
95 | </li>
|
---|
96 | <li>
|
---|
97 | <p>
|
---|
98 | Attach the ISO file that contains the operating system
|
---|
99 | installation that you want to install later to the virtual
|
---|
100 | machine. This is done so that the VM can boot from it.
|
---|
101 | </p>
|
---|
102 | <pre xml:space="preserve">VBoxManage storageattach "Windows XP" --storagectl "IDE Controller"
|
---|
103 | --port 0 --device 1 --type dvddrive --medium /full/path/to/iso.iso</pre>
|
---|
104 | </li>
|
---|
105 | <li>
|
---|
106 | <p>
|
---|
107 | Enable the VirtualBox Remote Desktop Extension, the VRDP
|
---|
108 | server, as follows:
|
---|
109 | </p>
|
---|
110 | <pre xml:space="preserve">VBoxManage modifyvm "Windows XP" --vrde on</pre>
|
---|
111 | </li>
|
---|
112 | <li>
|
---|
113 | <p>
|
---|
114 | Start the virtual machine using the
|
---|
115 | <userinput>VBoxHeadless</userinput> command:
|
---|
116 | </p>
|
---|
117 | <pre xml:space="preserve">VBoxHeadless --startvm "Windows XP"</pre>
|
---|
118 | <p>
|
---|
119 | If the configuration steps worked, you should see a
|
---|
120 | copyright notice. If you are returned to the command line,
|
---|
121 | then something did not work correctly.
|
---|
122 | </p>
|
---|
123 | </li>
|
---|
124 | <li>
|
---|
125 | <p>
|
---|
126 | On the client machine, start the RDP viewer and connect to
|
---|
127 | the server. See <xref href="rdp-viewers.dita#rdp-viewers"/> for details
|
---|
128 | of how to use various common RDP viewers.
|
---|
129 | </p>
|
---|
130 | <p>
|
---|
131 | The installation routine of your guest operating system
|
---|
132 | should be displayed in the RDP viewer.
|
---|
133 | </p>
|
---|
134 | </li>
|
---|
135 | </ol>
|
---|
136 | </body>
|
---|
137 |
|
---|
138 | </topic>
|
---|