Difference between revisions of "VirtualBox"

From ReactOS Wiki
Jump to: navigation, search
Line 26: Line 26:
  
 
[[File:rosdebug1c.png]]
 
[[File:rosdebug1c.png]]
 +
  
 
3) '''PuTTY''': start your favourite serial terminal (e.g. HyperTerminal, [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]) This is the program that creates the debug logs. PuTTY can listen to a COM port and write it to file. If you don't know what you're looking for, get the "For Windows on Intel x86" putty.exe file. It doesn't need to be installed; you just have to know where you downloaded it to.
 
3) '''PuTTY''': start your favourite serial terminal (e.g. HyperTerminal, [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]) This is the program that creates the debug logs. PuTTY can listen to a COM port and write it to file. If you don't know what you're looking for, get the "For Windows on Intel x86" putty.exe file. It doesn't need to be installed; you just have to know where you downloaded it to.

Revision as of 22:09, 26 June 2012

VirtualBox is a virtual machine for x86 architecture developed by Innotek and maintained by Oracle. There are two versions: the full VirtualBox package with a proprietary license and the VirtualBox Open Source Edition (GPL).

It's easier to configure than QEMU and slightly slower than VMware.


Getting debug output

Redirect to virtual serial port (com0com, Windows host)

Steps to be taken:

1) VirtualBox: Set up a serial port in VirtualBox. There are other VM's possible, but they all work the same: they can send a debug output to a COM port. Download VirtualBox, if you haven't done so yet. Like any other application that needs to access named pipes in Windows Vista, it must be run as Administrator. (Obviously, to debug/log ReactOS, you also need a ReactOS Debug build. It'll be named something like "bootcd-#####-dbg.7z" or "bootcd-#####-dbgwin.7z". You MUST use a Debug build. You will also need 7-Zip to get the ReactOS ISO out of the .7z file. See also Installing on virtual machine). When the VirtualBox-window opens, click on the tab "Settings". Click on "Serial Ports". Choose Port Mode = "Host Pipe", tick the Create Pipe option, Port Path: "\\.\pipe\ros_pipe".


IMPORTANT: Don't change the "COM1" port that appears in the Dropdown listbox. Keep it as COM1.

Rosdebug1.png


2) Com0com : This is the VirtualBox/PuTTY bridge. It gives you the option to have 2 COM port pairs, but you really only need 1 COM port pair. (Virtual Port Pair 0, for instance). Download and install com0com virtual comport redirector. See com0com tutorial for more info. You can change the default settings to "COM4" and "COM5", but it's not necessary and it doesn't matter. When in doubt, just leave the defaults ("CNCA0" and "CNCB0") as they are. However, be sure to check that the driver for com0com is installed correctly (with Device Manager, for instance).


IMPORTANT: You may have trouble installing its unsigned drivers on Vista and Win7. Windows Vista, 7, etc users will need to grab Driver Signature Enforcement Overrider Driver. Run it (with Admin privileges) and click the radiobutton of "Enable Test Mode". After you're in Testmode (you may have to reboot), install com0com. Normally, your OS will now detect 'new hardware' and you'll know it's working when your Device Manager shows several working drivers under "com0com - serial port emulators". You can turn off Test Mode by typing "bcdedit /set testsigning off" in the elevated command prompt (also run as administrator). One can find this at "Start", "Run", type "CMD", then type "bcdedit /set testsigning off" (enter).

Rosdebug1b.png

Rosdebug1c.png


3) PuTTY: start your favourite serial terminal (e.g. HyperTerminal, PuTTY) This is the program that creates the debug logs. PuTTY can listen to a COM port and write it to file. If you don't know what you're looking for, get the "For Windows on Intel x86" putty.exe file. It doesn't need to be installed; you just have to know where you downloaded it to. Make sure Session is selected on the TreeView on the left.

On Windows Vista it must be run as Admin, as anything that is to use named pipes. In the main part of the window, under "Connection Type", choose the radiobutton "Serial". Under "Serial Line" type the name of your other com0com (virtual pair 0) port. Following the above example, this will be "\\.\pipe\ros_pipe". Under speed, type "115200". Depending on your wish to log, you can go to the TreeView on the left and click on Logging under Session. Under Session Logging, choose "All session output". Log file name indicates where the debug log will be and what it will be called. Use the Browse button to change the location if you like, but make sure you know where it's being saved! Go back to the TreeView on the left and click on Serial (under Connection). Set Flow Control to None. PuTTY is now configured. Note that on the main page of PuTTY you can Save/Load configurations which makes it even easier.

Thus, after you elect the serial as connection type, set speed to 115200 baud and put the named pipe path as serial line ("\\.\pipe\ros_pipe"), you are ready to go. Of course, instead of "ros_pipe", you can use any unique name, only mind to follow the \\.\pipe\[pipe_name] scheme.

Click on "Open" at the bottom of the PuTTY-window. This activates PuTTY's debug-log-creating abilities, which is a black window with a flashing green cursor. If you can see your PuTTY window in the background, you'll see lots of text flying past as PuTTY does its thing. When you've finished with exploring ReactOS, you'll have your debug log. Alternatively, one can also just copy/paste everything from the black Putty-box. When you shut down the virtual machine, PuTTY will change to inactive state and display error message, but when you restart the virtual machine, you can easily reconnect that session by pressing right mouse button on window top bar and selecting Restart session.

Rosdebug2.png


4) Start ReactOS in DEBUG MODE in VirtualBox and watch the log.

Rosdebug3.png

Rosdebug4.png


Using VMwareGateway

You need to download the VMwareGateway application. Start it with /r option to make it run as a service (in Windows Vista you have to use an elevated CMD for this). You can download a x86/x64 build here that does not require VirtualBox to run elevated on Vista/Win7. Next you need to start the service, using SC command:

sc start vmwaregateway

Sort out any firewall pop-up if applicable. Finally, use your favorite telnet client to connect to localhost on port 567.

To configure your virtual machine, set it to Host Pipe with the following pipe address:

\\.\pipe\vmwaredebug

Make sure you do not mark the Create Pipe box. VMwareGateway has already created it. Debug output should appear in your telnet client PuttyTel.

Redirect to console (Linux host)

Setup a serial port in VirtualBox as shown below.

VirtualBox-4.0.8.Setup serial port for socat pipe.png

Using socat

If you just simply want a display of the debug output in a terminal window, socat works nicely.

The usage is very simple:

socat unix-client:pipe_path stdout

You could also do this:

socat unix-client:pipe_path stdio

Substitute "pipe_path" with the path of the pipe you created using VirtualBox (e.g. "/tmp/ReactOS-Debug.pipe").

If ReactOS crashes, you should still be able to type in the VirtualBox window - e.g. within a debug session. You'll see the input and output on the console window which socat is running in.

Using minicom

This guide is based on the terminal application minicom. First install it by typing:

sudo apt-get install minicom

Then you will have to configure a pipe. Type Ctrl+A, then O. Select Configure serial ports, and name the device unix#pipe_path where "pipe_path" is a file like /tmp/vboxlog which will be used as pipe between the virtual machine and minicom.

Create the new Virtual Machine in VirtualBox, then go to the Serial Ports configuration. Select Host pipe, type the "pipe_path" and select Create Pipe.

Make sure that pipe_path is exactly the same on both minicom and VirtualBox.

Redirect to file (Linux host)

When running minicom, type Ctrl-A then L. Type the name of the capture file.

Serial port output using com0com

Install and configure com0com according to the com0com guide.

Enable the first serial port for your ReactOS machine. Use port number "COM1", mode "host device" and port path "COM4" or whatever virtual port you created first with com0com.

Connect your terminal application to your second virtual port and start up VirtualBox.

Installing Guest Additions

Mount the CD in the CD-Drive and open the file VBoxWindowsAdditions.exe and follow the setup instructions.

Setting up audio

ReactOS has had limited support for sound since the 0.3.9 release, but it is recommended to test sound with a trunk build.

In VirtualBox Machine Settings, enable audio and set the following:

  • Host Audio Driver: Windows DirectSound
  • Audio Controller: ICH AC97

After installing ReactOS:

  1. Download the Intel AC 97 driver from ReactOS Application Manager
  2. Extract the files to C:\ReactOS\
  3. Restart the virtual machine
  4. Install and start your favorite audio playback or multimedia application (e.g. Winamp, VLC, MPlayer)
  5. Open an audio file and play

Known Issues

  • The AC97 Driver only supports PCM Wave Audio in the range 8000-44.100Khz, 16Bit Samples and 2 Channels
  • Sample rate conversion is not yet supported
  • The driver has issues when changing the sample rate of the audio stream