User Tools

Site Tools


usersguide:runningonvirtualbox

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
usersguide:runningonvirtualbox [2014/12/05 04:03]
lionelsambuc [Install issue (no hardware acceleration)]
usersguide:runningonvirtualbox [2018/01/08 21:04]
nnyby [Virtual Machine Setup] remove unnecessary setup step: utc time
Line 1: Line 1:
  
 +====== Running on VirtualBox ======
 +This page describes the process of installing MINIX 3 on VirtualBox.
 +
 +Confirmed to work with 
 +
 +^ VirtualBox ​    ^ Minix           ^ Host-OS ​          ^ Notes ^
 +| 4.3.36 ​        | 3.3.0-3234ff ​    | Debian 3.16.36 ​   | X not installed
 +| 4.3.36 ​        | 3.4.0rc2-373b793 | Debian 3.16.36 ​   | X works ok
 +| 5.2.4          | 3.4.0rc6 ​        | Debian 10 (buster)|
 +
 +===== Preliminaries =====
 +First of all you'll need to install [[https://​www.virtualbox.org|VirtualBox]]. VirtualBox binaries can be downloaded from their webpage. If you're running a Linux distribution,​ you can probably install VirtualBox via the package manager (e.g. with //apt-get install virtualbox//​ on Debian-like systems).
 +
 +===== Virtual Machine Setup =====
 +Before you install MINIX 3, you will need to create a new virtual machine configuration. The VM configuration specifies the parameters of your Virtual machine, e.g., how much memory you want the VM to use, how big you want the virtual hard disk to be, etc. Please see [[.:​hardwarerequirements|Hardware Requirements]] for guidelines.
 +
 +In the main screen of VirtualBox, click the big **New** button.
 +
 +  - At the //Name and operating system// screen, for //Name// write **MINIX3** (anything will work). ​
 +  - For //Type// select **Other**.
 +  - For //Version// select **Other/​unknown**.
 +  - At the //Memory size// screen, select the amount of memory for this Virtual Machine (e.g. **1024MB**).
 +  - At the //Hard Drive// screen set the size and properties of the Virtual Hard Disk. It is okay to either leave those options at their defaults or change them.
 +  - Pressing **Create** will create the Disk Image and the Virtual Machine that we  will run.
 +  - Now select **MINIX3** in the list on the left.
 +  - Click OK, and you are now ready to install MINIX 3!
 +
 +Troubleshooting:​
 +
 +  - If the installer fails to detect the virtual hard disk attached to a SATA controller, reconfigure the machine and attach the disk to the IDE controller. Also, make sure that the CDROM is attached to the IDE controller as well. (VirtualBox 5.1.22)
 +
 +===== Installation =====
 +Assuming you have downloaded and decompressed a MINIX 3 ISO image from the [[http://​www.minix3.org/​download|download page]], you can mount the ISO file:
 +
 +  - Select **MINIX3** in the list on the left.
 +  - Click **Start**.
 +  - You will be asked to select a start-up disk. Browse to and select the **.iso** MINIX 3 image you downloaded earlier and press **Open**.
 +
 +Then you can follow the [[.:​doinginstallation#​runningsetup|normal installation instructions]].
 +
 +When the installation is over, type
 +
 +<​code>​
 +poweroff
 +</​code>​
 +to exit Minix. The virtual machine will automatically close.
 +
 +===== Booting MINIX 3 =====
 +Now you have installed MINIX 3 on the virtual machine. The first thing that needs to be sorted out, is that next time you boot, you want to boot from the operating system, and not from the CD image.
 +
 +  - Make sure your VM is selected, then click the **Settings** button on the main screen.
 +  - In the menu on the right, click on **Storage**.
 +  - In the storage tree, select the installation .iso file and click the small remove button below.
 +
 +Great, now you can boot into the newly installed operating system.
 +
 +  - Press the big **Start** button on the main screen.
 +
 +===== Post-install Configuration =====
 +You should read [[.:​postinstallation|Post Installation]] for some configuration tips.
 +
 +==== X.org ====
 +
 +FIXME: This chapter needs to be re-written, as MINIX 3.3.0 does not install Xorg by default, where as MINIX 3.4.0 Beta //can// start X with no additional fiddling.
 +
 +VirtualBox'​s guest additions are not available for MINIX3. Therefore, MINIX cannot correctly guess the screen resolution. The desired screen resolution has to be set manually in the xorg.conf file.
 +
 +=== Changing screen resolution ===
 +
 +Make sure you are not running X!
 +
 +Login as root, and run the following command:
 +
 +<​code>​
 +# Xorg -configure
 +</​code>​
 +
 +This command should create a ''​xorg.conf.new''​ file in ''/​root''​.
 +
 +In ''​Section "​Screen"''​ from ''​xorg.conf.new''​ file, make sure to remove all ''​SubSection "​Display"'',​ except the one containing: ''​Depth:​ 16''​.
 +
 +Add the desired screen resolution. Possible screen resolutions can be found in ''/​var/​log/​Xorg.0.log''​. Search for ''​Modes:''​ containing ''​BitsPerPixel:​ 16'',​ this is important!.
 +
 +Example:
 +
 +<​code>​
 +*Mode: 117 (1024x768)
 +[...]
 + XResolution:​ 1024
 + YResolution:​ 768
 +[...]
 + BitsPerPixel:​ 16
 +[...]
 +</​code>​
 +
 +These resolutions can be added to the newly generated ''​xorg.conf.new''​ (in the example above: ''​1024x768''​). I was able to use the following resolutions:​ ''​320x200'',​ ''​640x480'',​ ''​800x600'',​ ''​1024x768'',​ ''​1280x1024'',​ ''​1152x864''​.
 +
 +Add the desired resolution to the ''​Modes:''​ key in ''​SubSection "​Display"''​.
 +
 +Example:
 +
 +<​code>​
 +[...]
 + Section "​Screen"​
 +[...]
 + SubSection "​Display"​
 + Viewport ​  0 0
 + Depth ​    16
 + Modes "​1024x768"​
 + EndSubSection
 + EndSection
 +[...]
 +</​code>​
 +
 +The ''​xorg.conf.new''​ file can now be moved to ''/​usr/​pkg/​X11R6/​lib/​X11/​xorg.conf'':​
 +
 +<​code>​
 +# mv xorg.conf.new /​usr/​pkg/​X11R6/​lib/​X11/​xorg.conf
 +</​code>​
 +
 +Test the new configuration file with by starting ''​X.org'':​
 +
 +<​code>​
 +# startx
 +</​code>​
 +
 +=== Sample xorg.conf ===
 +
 +Sample xorg.conf, location: /​usr/​pkg/​X11R6/​lib/​X11/​xorg.conf
 +<​code>​
 +Section "​ServerLayout"​
 + Identifier ​    "​X.org Configured"​
 + Screen ​     0  "​Screen0"​ 0 0
 + InputDevice ​   "​Mouse0"​ "​CorePointer"​
 + InputDevice ​   "​Keyboard0"​ "​CoreKeyboard"​
 +EndSection
 +
 +Section "​Files"​
 + RgbPath ​     "/​usr/​pkg/​X11R6/​lib/​X11/​rgb"​
 + FontPath ​    "/​usr/​pkg/​X11R6/​lib/​X11/​fonts/​misc/"​
 + FontPath ​    "/​usr/​pkg/​X11R6/​lib/​X11/​fonts/​TTF/"​
 + FontPath ​    "/​usr/​pkg/​X11R6/​lib/​X11/​fonts/​Type1/"​
 + FontPath ​    "/​usr/​pkg/​X11R6/​lib/​X11/​fonts/​CID/"​
 + FontPath ​    "/​usr/​pkg/​X11R6/​lib/​X11/​fonts/​75dpi/"​
 + FontPath ​    "/​usr/​pkg/​X11R6/​lib/​X11/​fonts/​100dpi/"​
 +EndSection
 +
 +Section "​Module"​
 +EndSection
 +
 +Section "​InputDevice"​
 + Identifier ​ "​Keyboard0"​
 + Driver ​     "​kbd"​
 +EndSection
 +
 +Section "​InputDevice"​
 + Identifier ​ "​Mouse0"​
 + Driver ​     "​mouse"​
 + Option  ​   "​Protocol"​ "​auto"​
 + Option  ​   "​Device"​ "/​dev/​mouse"​
 +EndSection
 +
 +Section "​Monitor"​
 + Identifier ​  "​Monitor0"​
 + VendorName ​  "​Monitor Vendor"​
 + ModelName ​   "​Monitor Model"
 +EndSection
 +
 +Section "​Device"​
 + Identifier ​ "​Card0"​
 + Driver ​     "​vesa"​
 + VendorName ​ "​Unknown Vendor"​
 + BoardName ​  "​Unknown Board"
 + BusID ​      "​PCI:​0:​2:​0"​
 +EndSection
 +
 +Section "​Screen"​
 + Identifier "​Screen0"​
 + Device ​    "​Card0"​
 + Monitor ​   "​Monitor0"​
 +
 + SubSection "​Display"​
 + Viewport ​  0 0
 + Depth ​    16
 + Modes "​1152x864"​
 + EndSubSection
 +EndSection
 +</​code>​
 +===== Port Forwarding =====
 +
 +VirtualBox has eight networking adapters which can be separately configured to operate in one of the following six modes:
 +  * Not attached.
 +  * Network Address Translation (NAT).
 +  * Bridged networking.
 +  * Internal networking.
 +  * Host-only networking.
 +  * Virtual Distributed Ethernet networking.
 +It is possible to browse the Web, download files and view e-mail inside the guest (MINIX 3) with the [[http://​en.wikipedia.org/​wiki/​Network Address Translation|Network Address Translation]] mode. In this default mode (NAT) the guest operating system can not access the host machine or other computers on the same network and vise versa. However, like a physical router, !VirtualBox can make selected services available through [[http://​en.wikipedia.org/​wiki/​Port_forwarding|port forwarding]]. This means that VirtualBox listens to certain ports on the host and resends all packets which arrive there to the guest, on the same or a different port.
 +
 +For example, to forward SSH traffic from host machine to guest machine on port 2222:
 +<​code>​
 +VBoxManage modifyvm "VM name" --natpf1 "​guestssh,​tcp,,​2222,,​22"​
 +</​code>​
 +
 +The "VM name" is the name of VM on the VirtualBox management screen, and "​guestssh"​ is purely descriptive name and will be auto-generated if omitted.
 +
 +Connecting to guest machine with following command on host machine
 +
 +<​code>​
 +ssh -p 2222 localhost
 +</​code>​
 +
 +The guest operating system is available for host machine and other machines on the network as well though the same port 2222 at the host's IP address (if host machine firewall allows it). This is useful for remote development and navigation with [[.:​..:​developersguide:​eclipsetutorial|Eclipse Remote System Explorer]].
 +
 +===== Workarounds =====
 +
 +==== VirtualBox 3.1 ====
 +
 +VirtualBox 3.1 is not able to boot MINIX 3. Please use the latest version of VirtualBox.
 +
 +==== Install issue (no hardware acceleration) ====
 +Symptom: kernel panic right after boot menu (CD loads and displays boot menu but panics right after)
 +
 +Workaround:
 +  - If you can enable hardware acceleration:​
 +    * Verify that your processor has the virtualization extensions (VT-x, AMD-V)
 +    * Enable hardware acceleration in your BIOS.
 +    * Go to the Settings dialog for your VM image by selecting it and clicking the **Settings** button on the main screen.
 +    * Click on **System**
 +    * Click on the **Acceleration** tab.
 +    * Check **Enable VT-x/​AMD-V**.
 +
 +  - If you aren't able to use hardware acceleration (e.g. VirtualBox 3.1.2 + Core 2 Duo + Minix 3.2.0):
 +    * Follow all the installation steps as above.
 +    * Uncheck **Enable VT-x/​AMD-V**.
 +    * Start your VM with this command: ''​%%VBoxSDL --startvm minix --norawr0 --norawr3%%''​.
 +    * Replace your VM image'​s name for //minix// in the preceding command.
 +    * VirtualBox 4.0 has no **Enable VT-x/​AMD-V** button, but you can issue this command to avoid kernel panics during installation:​ ''​%%VBoxSDL --startvm minix --norawr0 --norawr3%%''​
 +
 +==== DNS resolution not working ====
 +
 +When the MINIX3 virtual machine is using (at least) NAT networking configuration,​ it will obtain the DNS server address from the host system through DHCP. The VirtualBox-provided DNS server address is the exact same address as used on the host system. On some systems, this can lead to nonworking DNS resolution. For example, the host system uses a local resolver (on 127.0.1.1), which leads to the MINIX3 guest fruitlessly sending DNS requests to itself rather than the host's resolver. The result is that for example ''​pkgin up''​ gives "Host name lookup failure"​ errors.
 +
 +On MINIX3, the current DHCP-obtained DNS server settings can be checked with the command ''​dhcpd -q''​ - the DNS server address is listed as ''​DNSserver''​. If this address is indeed not a routable IP address, one may have to enable VirtualBox'​s DNS proxy, using [[https://​www.virtualbox.org/​manual/​ch09.html#​nat-adv-dns|these instructions from the official VirtualBox website]]. This should resolve the issue.
 +
 +===== Time zone issues =====
 +
 +If you have configured a time zone in MINIX3 (by for example putting the line "​export TZ=CET"​ in /​etc/​rc.timezone),​ and you find that your **clock** (printed by for example the "​date"​ command) ends up being **ahead** of real time by one or more hours, then take the following steps (tested on VirtualBox 4.1.6):
 +
 +  - Shut down and power off the virtual machine (at the moment this requires a hard power-off through the VirtualBox GUI);
 +  - Go to the //​Settings//​ of the virtual machine;
 +  - Go to the //System// tab;
 +  - Under //Extended features//, check the "​Hardware clock in UTC time" option;
 +  - Click on //OK// to save the change;
 +  - Restart the virtual machine, and the problem should now be fixed, even though the "​wrong"​ (GMT) date will be printed at bootup.
 +
 +Note that if your clock is **behind** for any reason, the MINIX3 **vbox** VirtualBox time sync driver will automatically correct the time for you.
 +
 +===== Shared Folders =====
 +
 +To use the shared folders feature please do the following:
 +
 +  - Ensure the virtual machine is currently off;
 +  - Go to the //​Settings//​ of the virtual machine;
 +  - Go to the //Shared Folders// tab;
 +  - Click the add button and select the folder to share from the host and assign it a name;
 +  - Click on //OK// to save the change;
 +  - Start the VM and login;
 +  - To mount your shared folder do the following:
 +
 +<​code>​
 +mount -t vbfs -o share=NAME none /mnt
 +</​code>​
 +
 +Be sure to replace NAME here with the name you assigned the share in step 4. Please also note that this cannot be entered into fstab for automatic mounting due to the fact that mounting takes place earlier in the boot process than the loading of the appropriate virtualbox driver for shared folders.
usersguide/runningonvirtualbox.txt · Last modified: 2018/01/08 21:04 by nnyby