<?xml version="1.0"?>
<!DOCTYPE webpage
  PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
        "http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">

<webpage id="docs-vmware">
  <config param="desc" value="Running VMWare on NetBSD"/>
  <config param="cvstag" 
    value="$NetBSD: vmware.xml,v 1.1 2007/06/09 11:32:57 dsieger Exp $"/>
  <config param="rcsdate" value="$Date: 2007/06/09 11:32:57 $"/>
  <head>
    <!-- Copyright (c) 2002-2003
    The NetBSD Foundation, Inc.  ALL RIGHTS RESERVED. -->
    <!-- Originally written by Leo Weppelman -->

    <title>NetBSD Documentation: Running VMWare on NetBSD</title>
  </head>


  <para>The information below was inspired by installing vmware 2.04
    on NetBSD-1.6 and NetBSD-1.6I.</para>

  <sect1 role="toc">
    <sect2 id="pitfalls-install">
      <title>Pitfalls in the installation</title>

      <sect3 id="rawdisk">
	<title>Raw disks don't work!</title>
	<para>This means that if you are in a situation that you
	  want/need a dual boot system you'll need a
	  'plainDisk'. Since vmware sometimes chokes on a disk
	  that contains a NetBSD disklabel, the best way to setup a
	  Plaindisk configuration is to configure a virtual disk in
	  the configuration wizard. The size does not matter since you
	  can remove the virtual disk afterwards. When the wizard is
	  finished, change the 'deviceType' of the disk in the .cfg
	  file to 'plainDisk'. Now you have to correctly fill in the
	  geometry of the 'plainDisk'. The filename is the 'fileName'
	  field in the disk description (usually:
	  ide0:0.fileName). The contents of that file should look
	  something like this:
	  <programlisting>DRIVETYPE      ide
CYLINDERS    16384
HEADS           16
SECTORS         63
  
ACCESS "/root/vmware/win2000/disk.mbr" 0 63
ACCESS "/dev/rwd0e" 63 8193087
ACCESS "/dev/rwd0f" 8193213 4176837
</programlisting>

	  The disk.mbr is a copy of the master boot record. You can
	  create it by:
	  <programlisting>
dd if=/dev/rwd0d of=disk.mbr count=63</programlisting></para>

	<para>Now that the mbr is a fake anyway, it is best to rip out
	  all partitions that vmware should not know about. They
	  sometimes give you mysterious crashes. The easiest way to
	  accomplish this is:
	  <programlisting>vnconfig vnd0 disk.mbr 512/63/1/1
fdisk -u vnd0
vnconfig -u vnd0</programlisting>
	</para>
	<para>
	  You might also like the '-a' and '-i' options of fdisk, boot
	  selectors are annoying when there is only one actual choice
	  left...</para>

	<para>To determine the other components of the plain disk,
	  you'll need fdisk too. The first numeric field is the
	  offset, the second one the size. You can directly take them
	  from the fdisk table.</para>
      </sect3>

      <sect3 id="profiles">
	<title>Hardware profiles</title>

	<para>Check out the vmware documentation on <ulink 
	    url="http://www.vmware.com/support/ws2/doc/hardwareprofiles_ws_linux.html">Setting Up Hardware Profiles in Virtual Machines</ulink>
	  This might save you some work in re-installing drivers for
	  the real hardware afterwards. It's not fatal, just very
	  annoying.</para>
      </sect3>

      <sect3 id="crashes">
	<title>Vmware segfaults and other mysterious errors</title>

	<para>For w2000 and XP, check out the part on <ulink 
	    url="http://www.vmware.com/support/ws3/doc/ws32_disks8.html#1009931">ACPI</ulink>
	  You will get lots of weird crashes (including vmware/sig11)
	  when this is wrong.</para>
      </sect3>

      <sect3 id="network">
	<title>Bridged networking</title>

	<para>If your w2000 needs all kinds of networks drives and
	  such, you really need bridged networking. NAT will just no be
	  good enough for the job. Nice thing is that this that this
	  works with NetBSD, although not in the most obvious
	  way.</para>

	<para>Start with configuring your virtual machine with
	  'HostOnly' networking. Now, setup a bridge like:

	  <programlisting>ifconfig bridge0 create
brconfig bridge0 add &lt;your main interface&gt; add vmnet1 up</programlisting>

	  I think you'll also need to enable packet forwarding by
	  adding:
	  <programlisting>net.inet.ip.forwarding=1</programlisting>
	  to <filename>/etc/sysctl.conf</filename>.</para>
      </sect3>

      <sect3 id="rtc">
	<title>Linux realtime clock (rtc) support</title>

	<para>The Linux RTC can be emulated using the linuxrtc
	  option. Please be aware that this option makes your CPU 0%
	  idle. It is only needed for Windows 9x for smooth rendering
	  of for example menus. The Linux RTC can be emulated 
	  by adding <quote>linuxrtc=YES</quote> to the
	  <filename>/etc/rc.conf</filename> file.</para>
      </sect3>
    </sect2>
  </sect1>

  <parentsec url="./" text="Documentation Top Level"/>
</webpage>

