Ticket #11526: Emulating Haiku in VirtualBox.txt

File Emulating Haiku in VirtualBox.txt, 17.2 KB (added by humdinger, 5 years ago)

Current "Emulating Haiku in VirtualBox"

Line 
1<br />Go to section:<ul>
2              <li>  <a href="#part_iso">Installing and running Haiku from an ISO image</a></li>
3              <li>  <a href="#part_vmimage">Running Haiku from a VM image</a></li>
4              <li>  <a href="#part_additional">Additional Steps</a></li>
5              <li>  <a href="#part_customVESA">Custom VESA Resolutions</a></li>
6              <li>  <a href="#part_trouble">Troubleshooting</a></li>
7            </ul>
8             
9            <h3 id="part_iso">Installing and running Haiku from an ISO image.</h3>
10             
11            The following guide will describe installation of Haiku on VirtualBox, using a ISO image.
12             
13            <h5 id="part_creatingv">Step 1. Creating a virtual machine.</h5>
14            After installing VirtualBox and downloading an iso image, we can begin the installation process. Installing operating systems in VirtualBox consists of two parts - first step is to create a virtual machine itself and then configure it to run the desired guest system installation.<br />
15             
16            We begin, by clicking the icon <span class="button">New</span> (or pressing <span class="key">Ctrl</span> + <span class="key">N</span>):
17             
18            <br /><img style="padding:12px" alt="virtualBox's main window" src="https://www.haiku-os.org/files/image1.png"/><br />
19             
20            We need to specify what kind of guest operating system we are going to install. This is helpful in pre-configuration of virtual machines – it applies default settings for supported OS’s. For Haiku, we are going to choose "<em>Other</em>" for operating system field and "<em>Other/Unknown</em>" for version:
21             
22            <br /><img style="padding:12px" alt="VM Name" src="https://www.haiku-os.org/files/image3.png"/><br />
23             
24            The next step is to define how much of the host’s physical memory we want to allocate for our virtual machine. This decision should be based on the amount of RAM the host has, but it is recommended to spend a minimum of 256mb of RAM to make it run smoothly. More memory can have an effect on the performance of the VM, but too much can slow down the host, so there needs to be a balance between the VM and host machine resources:
25             
26            <br /><img style="padding:12px" alt="Memory" src="https://www.haiku-os.org/files/image4.png"/><br />
27             
28            After we have done that, we need to create a hard disk image, that is going to be stored on the physical drive, under specified location. We click Create new hard disk (if it is not selected already) and click <span class="button">Create</span>:
29             
30            <br /><img style="padding:12px" alt="virtual hard disk" src="https://www.haiku-os.org/files/image5.png"/><br />
31                   
32                    Choose VDI and click <span class="button">Next</span>.
33                    <br /><img style="padding:12px" alt="Location and size" src="https://www.haiku-os.org/files/image7_1.png"><br />
34                                   
35            Here we can define how big the virtual hard disk should be. In most cases it is sufficient to use the default option, which is <em>Dynamically expanding storage</em>. This will allow the image file to grow as more content is saved in it, with no lack in functionality:
36             
37            <br /><img style="padding:12px" alt="Hard disk storage type" src="https://www.haiku-os.org/files/image6.png"/><br />
38             
39            The next slide will ask us for the location of the hard disk image file and maximum size of the dynamically expanding file. Input the values and click <span class="button">Create</span>:
40           
41           <br /><img style="padding:12px" alt="Location and size" src="https://www.haiku-os.org/files/image7_2.png"/><br />
42             
43            <!--break-->
44            <h5>Step 2. Configuring the virtual machine.</h5>
45             
46            Now we need to configure a few settings, to get things to work.<br />
47             
48            We click on the Settings icon that appeared for our virtual machine:
49             
50            <br /><img style="padding:12px" alt="Settings on main menu" src="https://www.haiku-os.org/files/image8.png"/><br />
51             
52            The settings window allows the user to configure the hardware aspects of the virtual machine guest OS will be using.  First of all we need to attach our ISO image with haiku installation to the virtual machine, in a form of emulated CD-ROM drive. To do that, we click <em>Storage </em>from the left panel, and then clicking on <em>Empty </em>in the <em>Storage Tree</em>. Then we click on the CD icon next to the CD/DVD Device drop-down list:
53             
54            <br /><img style="padding:12px" alt="CD/DVD Device" src="https://www.haiku-os.org/files/image9.png"/><br />
55             
56            Now we click on <em>Choose a virtual CD/DVD disk file...</em>. In the new window we point to the location where we stored our Haiku ISO installation and then Click <span class="button">Open</span> to confirm. Here is what we will see after that:
57             
58            <br /><img style="padding:12px" alt="Media manager" src="https://www.haiku-os.org/files/image10.png"/><br />
59             
60            After you are done with configuration, click <span class="button">OK</span> to move back to the main window.
61            <!--break-->
62            <h5>Step 3. Running Haiku installation.</h5>
63             
64            Hopefully, at this point everything is properly configured and we can run Haiku installation. To do so, click the Start Icon (or Machine -&gt; Start) to run the virtual machine. After a few seconds the right GUI should appear and begin the installation of Haiku in virtual environment.<br />
65             
66            The installation itself is quite simple and does not differ really from a physical one  (follow the guides <a href="http://www.haiku-os.org/get-haiku/installation-guide">on this page</a> if you are not familiar with installing haiku) although it can appear slower, depending on the performance of the host  (takes about 30 to 60 minutes to complete installation). Installing on virtual machine will also require partitioning changes which can be made directly in installation manager. The DriveSetup window should detect two mediums, one is our cd-rom (iso) file and another is a “hard drive” we created earlier. All we need to do is select that drive, go to <em>Partitions -&gt; Initialize</em>, click on <em>Be File System</em> and continue the installation.
67             
68            <br /><img style="padding:12px" alt="Haiku's DriveSetup" src="https://www.haiku-os.org/files/image11.png"/><br />
69             
70            And that’s it! After the installation is complete, the virtual machine window will redraw, to simulate rebooting of VM.  Unmount the CD image to prevent the ISO loading at each reboot by going to <em>Devices -&gt; CD/DVD Devices -&gt; Unmount CD/DVD Device</em>.
71            <!--break-->
72                    <hr />
73            <h3 id="part_vmimage">Running Haiku from a VM image</h3>
74            The following guide will describe installation of Haiku on Virtual Machine, using a VM hard disk image.<br />
75             
76            Begin by clicking the icon <span class="button">New</span> (or pressing <span class="key">Ctrl</span> + <span class="key">N</span>).
77             
78            <br /><img style="padding:12px" alt="Main menu" src="https://www.haiku-os.org/files/image8.png"/><br />
79             
80            We need to specify what kind of guest operating system we are going to install. This is helpful in pre-configuration of virtual machines – it applies default settings for supported OS’s. For Haiku,
81            we are going to choose <em>Other</em>for operating system field and <em>Other/Unknown</em> for version:
82             
83            <br /><img style="padding:12px" alt="Name and type" src="https://www.haiku-os.org/files/image3.png"/><br />
84             
85            The next step is to define how much of host’s physical memory we want to allocate for our virtual machine. This decision should be based on the amount of RAM the host has, but it is recommended to spend a minimum of 256mb of RAM to make it run smoothly. More memory can have effect on the performance of the virtual machine, but too much can slow down the host, so there needs to be a balance between the  virtual machine and host machine resources:
86             
87            <br /><img style="padding:12px" alt="Memory" src="https://www.haiku-os.org/files/image4.png"/><br />
88             
89            Now, choose "<em>Use an existing virtual hard drive file</em>" and then browse and select the file you had downloaded:
90            <br /><img style="padding:12px" alt="Add" src="https://www.haiku-os.org/files/image12.png"><br />
91                   
92            After the image appears, click <span class="button">Create</span> to confirm and move back to the main window.
93            <br /><img style="padding:12px" alt="Now with Image" src="https://www.haiku-os.org/files/image13.png"><br />
94           
95            No further steps nor configuration is required to make Haiku work, so we can move straight to executing the virtual machine. Click on the Start icon to boot VM.
96            <!--break-->
97             
98             
99            <!--break-->
100            <hr />
101                    <h3 id="part_additional">Additional steps</h3>
102            <!--break-->
103            <h5>Additional Step 1. Configuring the virtual machine.</h5>
104            There are a few settings that could be changed, for example to improve performance of Haiku. Remember that you need to divide resources responsibly, depending on your host specification.<br />
105             
106            We begin by clicking on the Settings icon.
107             
108            <br /><img style="padding:12px" alt="Settings on main menu" src="https://www.haiku-os.org/files/image8.png"/><br />
109             
110            The settings window allows the user to configure the hardware aspects of the virtual machine guest OS will be using.<br />
111             
112            One of the ways to increase performance if changing the video memory assigned to the virtual machine. On the left panel click Display tab, and move the first slider to the right, to increase the amount of memory assigned. This should allow the GUI to run more smoothly and be more responsive. 
113             
114            <br /><img style="padding:12px" alt="Display tab" src="https://www.haiku-os.org/files/image15.png"/><br />
115             
116            Another hint is to enable the hardware virtualization, which by default is disabled. On the System page, click the Processor tab and mark Enable PAE/NX to enable CPU address extension.
117             
118            <br /><img style="padding:12px" alt="Settings tab" src="https://www.haiku-os.org/files/image16.png"/><br />
119             
120            After you are done with configuration, click <span class="button">OK</span> to move back to the main window.
121            <!--break-->
122            <h5>Additional Step 2. Adjusting window settings.</h5>
123            One of the inconveniences users experience while using virtual machines are screen resolutions. By default, guest OS’s apply a big screen resolution, causing the windows to have scrolling bars on both sides to navigate in x-axis and y-axis. There are two solutions for that problem.<br />
124             
125            First solution is simply adjusting the screen resolution using tools built into system. In Haiku we can use the Screen preflet, which can be found under the Preferences menu. By changing the resolution the user will then notice that size of the VM window has now changed.
126             
127            <br /><img style="padding:12px" alt="Haiku's Screen Preflet" src="https://www.haiku-os.org/files/image17.png"/><br />
128             
129            Another way, is to install VirtualBox Guest Additions. They are designed to be installed inside a virtual machine after the guest operating system has been installed and consist of device drivers and system applications that optimize the guest operating system for better performance and usability (including graphical interface).  Unfortunately, there is no support for Guest Additions for Haiku yet, meaning for now the GUI needs to be controlled using system tools.  As soon as Guest Additions for Haiku will be released, this guide will be updated. For now that is the only way to solve that problem.
130            <!--break-->
131            <h5>Additional Step 3. Expanding the size of the VM hard disk image.</h5>
132            Often users find the size of original VM Haiku image not big enough to fulfil their needs. By default that size is about 600mb and in this step we are going to expand it. There is a way to do it, but it’s not as easy as it sounds. Just like a regular hard drive, once created, its physical boundaries cannot be expanded any more (the size of the disk, not partitions). The solution could be reinstalling, or cloning  the content of smaller hard drive into bigger one. That is exactly what we can do in this situation.<br />
133             
134            First we need to create a new hard disk of fixed size. Open <em>Virtual Media Manager</em> (<span class="key">Ctrl</span> + <span class="key">D</span>) and click New icon (or <em>Actions -&gt; New</em>). Then click <span class="button">Next</span>.
135             
136            <br /><img style="padding:12px" alt="Fixed-size storage" src="https://www.haiku-os.org/files/image18.png"/><br />
137             
138            Choose the <em>Fixed-size storage</em> option and click <span class="button">Next</span>. On the next slide choose a name, location and size for a <span class="path">.vdi</span> image and click <span class="button">Next</span>.
139             
140            <br /><img style="padding:12px" alt="Size" src="https://www.haiku-os.org/files/image19.png"/><br />
141             
142            Click <span class="button">Finish</span> to confirm action.<br />
143             
144            For the next step we will need to switch to the command-line environment, to perform the cloning process. These steps need to be done on the host OS. Depending on OS installed instructions may vary (see <a href="http://www.virtualbox.org/manual/ch08.html">here</a> to get more information). Open the terminal/console and navigate to the location where VirtualBox was installed and run the following command:
145             
146            <pre class="terminal">VBoxManage clonehd [location of .vdmk VM hard drive image] [location of hard drive we created earlier] –-existing</pre>
147            for example: (Windows host platform)
148            <pre class="terminal">“C:\Program Files\Oracle\VirtualBox\VBoxManage.exe” clonehd C:\haiku-r1alpha2.vmdk C:\new.vdi --existing</pre>
149            After executing this instruction the progress calculator will appear and return the uuid when finished.
150             
151            <br /><img style="padding:12px" alt="CMD output" src="https://www.haiku-os.org/files/image20.png"/><br />
152             
153            Now all we need to do is to re-create the virtual machine using steps described <a href="http://www.haiku-os.org/guides/virtualizing/virtualbox#part_creatingv">here</a>, only changing the hard drive to the one we just created (<span class="path">new.vdi</span>).
154             
155            <br /><img style="padding:12px" alt="With the new image" src="https://www.haiku-os.org/files/image21.png"/><br />
156             
157            After the process if completed, we can delete the old, smaller hard drive VM image, and boot the new one we have just created.
158            <!--break-->
159            <hr />
160                    <h3 id="part_customVESA">Custom VESA Resolutions</h3>
161
162            Example:
163            <pre class="terminal">VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16"</pre>
164            <!--break-->
165            <hr />
166
167                    <h3 id="part_trouble">Troubleshooting</h3>
168            <!--break-->
169            <h5> 1. Haiku cannot connect to the internet</h5>
170            There are some known issues with the network cards on VirtualBox virtual machines. The symptom is simply the inability to connect to other computers over the Internet. A solution to this problem is as follows:<br />
171             
172            Go to the settings of Haiku virtual machine (it needs to be shutdown first) and click <em>Network -> Advanced-> Adapter type -> Intel PRO/100 MT</em>.  Accept changes by clicking <span class="button">OK</span>.
173             
174            <br /><img style="padding:12px" alt="Intel PRO/100 MT" src="https://www.haiku-os.org/files/image22.png"/><br />
175             
176            Now the network services should be working properly. 
177            <!--break-->
178            <h5>2. USB mice are not working in Haiku when using a Virtual Machine</h5>
179             
180            Sometimes when there is more than one pointing device installed on the host OS, the secondary devices does not fully cooperate with Haiku VM. This is a known issue which can be easily fixed by the use of Virtualbox Guest Additions, as it is connected to mouse integration. Because Guest Additions for Haiku are not implemented yet, the only solution for that problem is to keep on using the primary pointing device, or make the USB mouse the main pointing device. This should be fixed as soon as Guest Additions for Haiku are officially released, but for now, there is no easy way to solve this issue.