Topic: vmware3 on FreeBSD

After several installations of this, I decided to write this howto.  I've seen a few, but there are problems that I've run into each time, and I now have a system.  I'm writing this mostly for myself, for the next time that I have to do this. I welcome comments of a better way.

I want to thank fmj who was an enormous help with my vmware installations.  All mistakes are his--oops, I meant mine, but at least one best selling author always gets away with a line like--thanks to all of them and any mistakes are theirs.

I have found that I am unable to successfully do a new installation of vmware3 on CURRENT.  It might die during the build or it might install, and coredump when I run the vmware-wizard.  I have, in at least one case, been able to install it on a 6.x release and then update that machine to CURRENT and have it continue to work.  (However, I haven't, once it is upgraded to CURRENT, been able to run a new instance of vmware wizard)

I have not tried to create a new vmware virtual disk manually on CURRENT.  That might work, as the problem seems to be more with the wizard than with vmware itself. 

I have also found (as this might soon be of interest) that it will install on a clean installation using Xorg-7.x with X11BASE being /usr/local.  (Defined in /etc/make.conf)  By default, at present, it will install in /usr/X11R6.  (See the xorg FreeBSD wiki for a discussion of moving X11BASE to /usr/local.)

So, first, install vmware from ports. 

cd /usr/ports/emulators/vmware3
make install clean

It will pull in linux_base-fc-<version>.
During installation, it will ask if you wish to configure the vmnet interface.  Choose yes.  It will then ask if you wish to use netgraph bridging.  Again, choose yes.  It will then ask to which interface do you wish to tie the netgraph bridging.  Choose your internal interface--that is, if you have a multihomed machine, choose the interface that works with yor internal network.  If you just have one interface and reach the Internet through a router or another machine, just choose your network interface, for example, fxp0 (if it's an Intel) vr0 (if it's a via), etc.

There is some documentation in the port's directory.  Rather than being directly there, as pkg-message, it's in /usr/ports/emulators/vmware3/files and called pkg-message.in 

After installation, a few things are necessary.  Contrary to the documentation, I have not found it necessary to load the aio module (or add VFS_AIO to the kernel.)

However, there  are a few more things you will want to do.  Once it is installed, add

kern.ipc.shm_allow_removed=1

to /etc/sysctl.conf
(You can put that in force immediately, of course, with the sysctl command, doing

sysctl kern.ipc.shm_allow_removed=1

Add the following to /boot/device.hints

hint.apic.0.disabled="1"

(I've never been sure how to get this working without a reboot, but actually, the first run should work without it. )

You will have to mount linprocfs
Add the following to /etc/fstab

linprocfs               /compat/linux/proc linprocfs rw         0       0

kldload the module and mount it

kldload linprocfs
mount /compat/linux/proc

vmware3 installs a script in %%PREFIX%%/etc/rc.d called 001.vmware.sh.  %%PREFIX%% will be /usr/X11R6 by default or, if the X11 folks' proposed changes take place, /usr/local.  As mentioned above, both work. (At time of writing, late December, 2006, it will be /usr/X11R6 unless you specifically set X11BASE to /usr/local.  As newcomers may also read this, note that the easiest way to change the default X11BASE  would be to add the following to /etc/make.conf.

X11BASE=/usr/local

However, newcomers, be warned.  If you don't understand this, you should probably stick to the defaults, as this might cause other things to break.   On the other hand, if you're doing a brand new installation of FreeBSD, it might be a good thing to add to /etc/make.conf, a file which you will probably have to create.

For the rest of this article, I'm going to assume you have the default of /usr/X11R6.  If it's still useful in 6 or 8 months, and you don't see these files in /usr/X11R6 then check /usr/local.  smile

Start the vmware script

/usr/X11R6/etc/rc.d/001.vmware.sh start

Now you have vmware installed.  The first thing to do is to run the vmware-wizard.  The rest of this can be done as normal user in your $HOME directory. 


Run the wizard

vmware-wizard

Here is the first real problem.  It will ask for a serial number.  The vmware company no longer supports vmware3, so it will not sell you one.  You will have to have one--one from a Linux vmware3 will work.  Googling will often bring you a legitimate serial number.  Using a friend's linux vmware3 serial number will work and he won't get arrested.  Basically, the vmware company no longer seems to care about vmware3, however, they aren't going to post a usable serial number on their site, which seems a bit rude of them. 
It will open a dialog that is pretty straight forward. It asks you choose the type of system you'll be installing.  Neither fmj nor myself have gotten it working well with LInux, and actually, both of us needed some programs only available in Windows.  (When installing Linux distributions, I could get it installed, but couldn't run anything in X.)



The wizard's defaults seem to be mostly for Linux.  For example, for cdrom it chooses ./dev/cdrom rather than /dev/acd0.  Edit it so that it points to your CD device, e.g. /dev/acd0.    I choose to disable the floppy drive, since I've never needed it.  For networking, choose host only, not bridged, even though you chose bridged during installation.

When this is done, you can start vmware

vmware

It will ask you if you want to run the wizard, the configuration editor or open an existing configuration. 
It will give various hints, saying this or that isn't going to work--these can usually be ignored, and you can also choose, with most of them, to not show the hint again.

Navigate to the existing configuration which will be something like
/home/scottro/vmware/Win2000pro/Win2000pro.cfg

Of course, unless your user name is scottro, the path will be a bit different, but in other words, your $HOME/vmware/<TYPE_CHOSEN_BY_WIZARD>/something.cfg

You'll get some more warnings and hints that can be ignored.

Insert the CD of the O/S that you wish to install.  Depending upon your needs, if Win2k will do it, it will run a bit more quickly in vmware than will WinXP.  (I need it primarily for walking users through various things, and also to run a Nortel VPN client, so for my needs, Win2k is fine.)
Note that games and the like are quite slow in vmware, and to me, it's not worth installing it for that.  I was hoping to get Windows' pinball working, and it does work, but it acts as if it's on barbituates.

Click the power on button (in the vmware interface, not on your computer) It's in the upper left of the vmware window.
A virtual machine will boot up.  You might get a warning about a floppy, no such device.  I find the easiest way to get around this nuisance is to choose F2 for setup as the virtual machine boots, and disable the  floppy drives shown in the virtual machine's (henceforth known as VM) BIOS.

It should see the CD and go through the installation.  It will give a message that there is no usable disk, and give you the option to hit C to continue.  Then, it will create the partition and offer to format it. (This is for a WIn2k installation--it's the same message you would get if booting a Win2k CD on a machine with no FAT or NTFS partitions.)

After that, it pretty much proceeds like a normal Win2k or XP install. It is usually quicker than an installation on an actual machine.

During the networking phase, just accept defaults and join a workgroup.  (I haven't tried to join a domain during installation, so I'm not sure if that will work or not.)

When it's done, it will boot up.  You'll log in.  The mouse will be confined to the VM's screen--you won't be able to reach the vmware menu, which is outside of the VM. To release the mouse (there is a message to this effect) hit ctl+alt. 

You can ignore warnings about video and mouse.  However, the first thing you want to do is install vmware tools.  Release the mouse with ctl+alt and go to Settings=> VMwareTools install.  It will again give various warnings and hints but install the tools.  This will improve the video.  After they've been installed, you can right click on the desktop and adjust the settings to 800x600 or 1024x768.


Now, networking.  This should work.  If it doesn't, take a look at your /usr/X11R6/etc/vmware/config file.  (Do this after closing vmware.)

You should see

vmnet1.Bridged = "YES"
vmnet1.BridgeInterface = "fxp0"
vmnet1.HostOnlyAddress = "192.168.0.1"
vmnet1.HostOnlyNetMask = "255.255.255.0"

(That is assuming your LAN interface is fxp0.  You want to be sure it's pointing to the LAN interface, whether it's fxp0, (Intel) vr0 (via) etc.  You can always check that with ifconfig.

What is peculiar about this is that if you choose bridged in the  the vmware-wizard, or later, with the configuration editor, it will not work.   So, choose bridged during installation of the port and host only for everything afterwards, that is, the vmware-wizard when setting up your virtual machines.

Last edited by scottro (2008-03-09 02:19:17)

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

Very nice in depth howto, great work scottro, You almost convinced me to try vmware wink

"religions, worst damnation of mankind"
[color=Blue]Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for

Re: vmware3 on FreeBSD

Hold off for a day or so.  Now, fmj is telling me I'm wrong about choosing host only during install, and I have to clear up another box to double check that.  I AM sure about host only during configuration of each VM though.

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

thx for care, but I doubt I will try vmware in short time, but good luck to You and fmj with polishing the howto.

I am quite happy about qemu, its simplicity and comfort of usage, no need to configure network with 192.... dhcp is automagically used for internat > internet config, I have to load only 2 modules [aio / kqemu] and create one very simple script containing one line ifconfig ${1} 0.0.0.0 and qemu is ready to use, one cmd to create img, second to install os third to use it, after recent upgrades snapshot releases are getting better and better and I use qemu only from time to time.

vmware is propably faster but I do not prefer to use linux emulaiton or go with no acpi.

I wait, like propably many other people for native vmware, but that will not come fast.

I am also curious about win4bsd speed, but as I said I am quite happy about qemu wink

"religions, worst damnation of mankind"
[color=Blue]Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for

Re: vmware3 on FreeBSD

The win4BSD is probably about the same as qemu.  It's more or less a more polished version.

I bought it, as I said, because here in the US, $50.00 isn't that much money even when you're not that rich, and I wanted to support a commercial BSD venture that I could afford.  I'm actually waiting for it to come out with an improved version which should fix a couple of things that I need fixed for my own special needs. 

As for polishing the howto, well, now I'm curious. It makes much more sense that one should choose bridged during installation since that seems to be necessary for the config file.  However, I did test and you definitely run into problems if you don't choose host only for each VM's installation.

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

In the end, I stayed up pretty late to test this.  The howto has been revised.  The key seems to be to choose bridged networking during installation but choose host only with the setup of the VM's.

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

vermaden, you should do a qemu howto then.  I havne't used it in awhile, the last time I did, it was too slow and networking was non-trivial.

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

there You go: smile
http://forums.bsdnexus.com/viewtopic.php?pid=13709

"religions, worst damnation of mankind"
[color=Blue]Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for

Re: vmware3 on FreeBSD

Sigh, I upgraded CURRENT yesterday, and now vmware won't load the vmmon_up module.  Apparently there's a kernel/module mismatch and googling has yet to bring me joy.  The trouble is that as I said in the original howto, vmware doesn't build well on CURRENT.  Even though the module is in the correct location, kldload doesn't see it. 

(If anyone is interested, I made a post on CURRENT--that thread can be found here.)

Last edited by scottro (2007-01-02 16:23:42)

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

Hrm, interesting about the networking.  As I said, for me what I do is choose the bridged network during vmware installation, but for the host setup choose host only.  However, if you had another way that worked, that's good too. smile

Enlightenment, from what I understand (haven't researched this thoroughly as I don't use either one) is, despite all the effects, supposed to be relatlively lighteweight.    I run vmware on a machine that uses fluxbox. 

Thanks for the feedback.

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

It took me quite some time to find a proper "license".

I hope the admins/mods won't object to posting this here:

NAME: rth77
Serial: 6818X-84WD1-01KDK-3JN9X

Also, a small error in the howto above:
sysctl kern.ipc_shm_allow_removed=1
should ofcourse be
sysctl kern.ipc.shm_allow_removed=1

Last edited by Carpetsmoker (2008-03-08 18:13:50)

Trust me, I know what I'm doing.

12

Re: vmware3 on FreeBSD

Have you tried the update to VMware3 that allows it to run on 7.0 yet?  I've not done so, but will try to in the near term.

Re: vmware3 on FreeBSD

Yes, I am trying it now.
So far it seems to work fine with Windows XP has guest OS.

Trust me, I know what I'm doing.

14

Re: vmware3 on FreeBSD

Cool!  I had no reason to doubt the info on the lists, but it always helps to get independent confirmation.

Re: vmware3 on FreeBSD

But it's incompatible with SMP?

F!XMBR

Freedom is the sure possession of those alone who have the courage to defend it. --Pericles

16

Re: vmware3 on FreeBSD

Yes -- no SMP.  As soon as you disable APIC you have no SMP. 

So I have it labeled at the top of /boot/device.hints, and uncomment it and reboot when I need to use VMware.  It is not convenient, but even with a single CPU it works better than Win4BSD and qemu/kqemu, at least for me.  If you have more modern hardware, one of the others may be a better choice.  But on my old dual Athlon (that's two Athlon MPs, not the newer dual core ones) VMware still works the best.

Let's hope that Orlando is making good progress on VMware 5/6, or that someone contributes the kernel code to VirtualBox .  My guess is that Orlando is being held up by the improvements to the linuxator, but I've not corresponded with him recently.

Re: vmware3 on FreeBSD

Thank you carpetsmoker.  I've fixed it in the original post.  (I didn't put a mention in there, but anyone who reads down far enough to find yours will see mine a few posts after it. )  smile

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

Now they're both wrong (cmdline and sysctl.conf example)
There should be a dot ('.') after 'ipc', not a underscore ('_')

Trust me, I know what I'm doing.

Re: vmware3 on FreeBSD

Sigh, one of those days.  Fixed now, thank you.

<@andre> i would be so much more efficient if i wasn't so stupid

Re: vmware3 on FreeBSD

I've used VMWare for a bit now, it seems to be faster than QEMU, but there are several issues:

- Kernel panics on occasion ... It seems to be related to vmnet networking, I never got a kernel panic if I disabled networking ...

- I can't use full screen because VMWare3 can't initialize the DGA extension ... As far as I could find there is no workaround other than using XFree vAncient?

- I used a "undoable" disk type, I made a lot of changes in Windows, I properly powered off and tried to commit the changes ... VMWare kept complaining that it couldn't commit the changes because of a disk version mismatch (..?)
Anyway, hours of work lost sad Not sure what happened but I wouldn't recommend the undoable disk type ...

Last edited by Carpetsmoker (2008-03-13 18:47:58)

Trust me, I know what I'm doing.

21

Re: vmware3 on FreeBSD

Lack of full screen is a known bug discussed in the documentation that is part of the port.  I can't speak to the rest of the issues, but I have never had any issues, ever, using it on 6.x.  I don't remember the disk type I used (probably default, whatever that is).

Re: vmware3 on FreeBSD

O.o I didn't read the pkg-message, I'm such an idiot ><

4) Load the kernel module aio.ko or add it to the kernel
   with 'options VFS_AIO' -- otherwise expect problems.

I didn't do that, so this may explain kernel panics ...

[edit] Ok, I loaded AIO and experienced two more kernel panics...

I guess now is a good time to figure out how gdb works ...

Last edited by Carpetsmoker (2008-03-14 13:42:19)

Trust me, I know what I'm doing.