# VM for FreeBSD



## DrJ (Jul 5, 2010)

I am trying to find a virtual machine in which I can run FreeBSD effectively.  This will be on Win7 64-bit.  I am very dissatisfied so far, and I am soliciting advice on how to proceed.

The newest Gneome version does not work.  Fortunately I had a VM on another computer that could be transferred.  I want to put email into Evolution, and I have about 3GB of email messages that I wish to transfer.  Evolution is not stable in its current form, though the one that comes with 2.28 seems to be OK.

I have used VMware Player 3.1, but the audio does not work right.  VMware tools do not work for FreeBSD with this version, and while the open-source tools work OK for the mouse and monitor, the sound does not.

Reverting to VMware Player 3.0.1, the audio works, but only for a short time.  I have not been able to get through a complete YouTube video without the Ethernet card freezing.  Right now I am using a decent em adapter (the Intel gigabyte card) in lieu of the Realtek nonsense that comes with the motherboard.  So this too is broken.

Virtualbox does not seem to have FreeBSD guest additions for a Win7 system (or any others, it seems).

How on earth can one install an effective desktop VM for FreeBSD?  I'd like to have my email on it, be able to do "risky" browsing (including Flash), and have access to the many documents I have formatted with groff.  But nothing seems to work right, at least not completely.

I'm trying to use 8.0-RELEASE p2 and a recent version of Gnome.  It is not an option to run on raw hardware, since I need too many PDF and image tools that simply do not exist on FreeBSD.


----------



## vermaden (Jul 5, 2010)

DrJ said:
			
		

> The newest Gneome version does not work.


What GNOME has to do with VirtualBox?



> VMware tools do not work for FreeBSD with this version, and while the open-source tools work OK for the mouse and monitor, the sound does not.


I remember that I needed to create a symlink for libc library and 'commersial' VMware tools worked, but I havent tested the sound either, since that was for a server.



> Virtualbox does not seem to have FreeBSD guest additions for a Win7 system (or any others, it seems).


Just grab the additions ISO from newer VirtualBox release, there will be these additions and will work inside Windows 7 on FreeBSD's VirtualBox installation.


----------



## DrJ (Jul 5, 2010)

vermaden said:
			
		

> Just grab the additions ISO from newer VirtualBox release, there will be these additions and will work inside Windows 7 on FreeBSD's VirtualBox installation.



Thanks -- I'll give that a try.


----------



## piggy (Jul 5, 2010)

vermaden said:
			
		

> I remember that I needed to create a symlink for libc library and 'commersial' VMware tools worked, but I havent tested the sound either, since that was for a server.


Which link? It is not clear. And BTW in my experience stock VMware Tools in VMware 7.0.1 used to work perfectly before the latest glibc upgrade.


----------



## piggy (Jul 5, 2010)

DrJ said:
			
		

> I am trying to find a virtual machine in which I can run FreeBSD effectively.  This will be on Win7 64-bit.  I am very dissatisfied so far, and I am soliciting advice on how to proceed.


My actual setup is exactly like yours and everything work just completely fine but stock VMware Tools after glibc upgrade.



			
				DrJ said:
			
		

> I've used VMware Player 3.1, but the audio does not work right.  VMware tools do not work for FreeBSD with this version, and while the open-source tools work OK for the mouse and monitor, the sound does not.



It work PERFECTLY here with open VMware tools (version open-vm-tools-253928). So u have to check both your host and guest for misconfiguration. I can even play like one hour flash movie inside browser with no glitch. My host machine got 8 GB of ram and my Freebsd box just do have 644 MB RAM with KDE 4.4.5 loaded, two terminals (gnome terminal under KDE, I like it more) window and Firefox 3.5.9 with 17 tabs open and still run smooth.

PS: I do have other three virtual machines (PCBSD, my actual Skype server , Archlinux and Fedora 13) running in the same time and BTW my Windows 7 Ultimate 64 bit host do have 46981 handle open, 1557 thread running, 111 processes and uptime of 46 days, 8 hours, 7 minutes and 11 seconds.

My Freebsd virtual machine stats are this:


```
last pid: 10621;  load averages:  1.52,  1.86,  1.36  up 0+00:23:55    20:58:16
102 processes: 2 running, 100 sleeping

Mem: 365M Active, 184M Inact, 77M Wired, 15M Cache, 77M Buf, 21M Free
Swap: 1943M Total, 1943M Free


  PID USERNAME    THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
 1339 max           9  44    0   192M   130M ucond    3:53  5.96% firefox-bin
 1346 max           1  49    0   405M   101M RUN      2:14  5.96% npviewer.bin
 1257 max           1  48    0   132M 39152K select   1:48  4.98% kdeinit4
 1373 max           1  46    0   405M   101M pcmwr    0:32  2.98% npviewer.bin
 1170 root          1  44    0 72884K 65852K select   0:47  0.98% Xorg
 1316 max           1  44    0   277M 35892K select   0:24  0.00% kdeinit4
 1291 max           1  44    0   315M 57920K select   0:22  0.00% kdeinit4
 1306 max           1  44    0 40860K 14172K select   0:10  0.00% vmware-user
 1287 max           1  44    0   297M 42512K select   0:10  0.00% kwin
 1305 max           1  44    0   302M 46576K select   0:07  0.00% kdeinit4
 1352 max           1  44    0   405M   101M futex    0:05  0.00% npviewer.bin
  971 root          1  44    0 21588K  3868K select   0:05  0.00% vmtoolsd
 1377 max           2  50    0 46148K 15852K piperd   0:04  0.00% gnome-termina
 1162 root          1  44    0  3796K  1480K select   0:03  0.00% hald-addon-st
 1254 max           1  44    0 96248K 24104K select   0:03  0.00% kdeinit4
```
The virtual system was just rebooted after KDE 4.4.5 upgrade.


----------



## DrJ (Jul 5, 2010)

piggy said:
			
		

> My actual setup is exactly like yours and everything work just completely fine but stock VMware Tools after glibc upgrade.


I found that out the hard way.


> It work PERFECTLY here with open VMware tools (version open-vm-tools-253928). So u have to check both your host and guest for misconfiguration.


I have checked this.  The audio portion claimed that the address was out-of-range, and closed.  The driver is the right one, and Gnome found all the audio stuff.  It is just that it could not initialize properly.

I suppose I should update everything and try again.



> My host machine got 8 GB of ram and my Freebsd box just do have 644 MB RAM with KDE 4.4.5 loaded, two terminals (gnome terminal under KDE, I like it more) window and Firefox 3.5.9 with 17 tabs open and still run smooth.


My box is much the same, and it is reasonably responsive -- much more so than the hardware it is replacing where it runs FreeBSD.  While that box was blazingly fast in its day, these days, well, it is a dog.


----------



## itsbrad212 (Jul 5, 2010)

I've always found QEMU to do the job.

*On an x86 machine:*
Create a hard disk (20GB - you can adjust it):

```
qemu-img create -f qcow2 freebsd_disk 20G
```

Then, boot the iso and the hard disk and install the operating system:

```
qemu -cdrom freebsd.iso -boot d freebsd_disk
```

Finally, boot the installed operating system:

```
qemu freebsd_disk
```


*On an x86_64 machine:*
Create a hard disk (20GB - you can adjust it):

```
qemu-img create -f qcow2 freebsd_disk 20G
```

Then, boot the iso and the hard disk and install the operating system:

```
qemu-system-x86_64 -cdrom freebsd.iso -boot d freebsd_disk
```

Finally, boot the installed operating system:

```
qemu freebsd_disk
```

There


----------



## DrJ (Jul 5, 2010)

I've used it before, but unless qemu has changed a great deal in the last couple of years it is terribly slow in comparison with VMware or VBox.


----------



## itsbrad212 (Jul 5, 2010)

DrJ said:
			
		

> I've used it before, but unless qemu has changed a great deal in the last couple of years it is terribly slow in comparison with VMware or VBox.



I wouldn't necessarily say that. I've gotten great performance out of it, and it has supported every operating system I throw at it, even I kernel I wrote myself!

EDIT: I have only used it for a year or so, so I cannot comment on changes that occurred earlier on.


----------



## DrJ (Jul 5, 2010)

Well, I've done the benchmarks.  qemu is OK for computational stuff, but its disk controller is less intelligent and the video driver is terribly slow.  You can feel it in the mouse too.  Also the Ethernet throughput was not as good.  These are compared with the old VMware 3.2.1 that probably still is in ports.

These data are a few years old now, so things might have changed.  But I doubt it.


----------



## itsbrad212 (Jul 5, 2010)

DrJ said:
			
		

> Well, I've done the benchmarks.  qemu is OK for computational stuff, but its disk controller is less intelligent and the video driver is terribly slow.  You can feel it in the mouse too.  Also the Ethernet throughput was not as good.  These are compared with the old VMware 3.2.1 that probably still is in ports.
> 
> These data are a few years old now, so things might have changed.  But I doubt it.



Yeah, from a developers standpoint, it's quick and easy to use, but I can't comment on the video drivers, as I rarely run X and such. I find that it's more for toying around before I commit to an actual install of an OS.


----------



## DrJ (Jul 5, 2010)

I'm sure it is fine for your purposes.  It just doesn't suit my needs.


----------



## DrJ (Jul 5, 2010)

Just curious, piggy, what versions of the linuxator and flash are you using?  I'm using linux_base-f10-10_2 and linux-f10-flashplugin-10.0r45.  I don't think that Gnome vs. KDE should make a difference.  I do notice that there is a large version difference between the open-vm-tools that is current and that I tried.  I'd bet that is the difference.

Of to try that now.  The Internet has been a bit dodgy here today.


----------



## DrJ (Jul 6, 2010)

Well, it is not the version of the open-vm-tools.  I have a second FreeBSD VM that is pretty current, so I reinstalled Player 3.1  On the FreeBSD side I installed the sound stuff this time.  Still no go.  I get the same message that the device ID is out of range for my system.  Also, the mouse control is really lousy.  The VMware tools are much better in this regard.

Suggestions?


----------



## sossego (Jul 6, 2010)

VirtualBox uses some qemu code. There is Xen- not sure how it works.
Qemu has kqemu.
Back to original post on here.
If VMWare works for you, then stay with it.


----------



## DrJ (Jul 6, 2010)

My guess is that VBox cleaned up the ousy I/O interfaces and kept the core computational part, which is pretty decent.  That's what it needed.

Right now VMware does not do what I need.  *argh!*


----------



## vermaden (Jul 6, 2010)

piggy said:
			
		

> Which link? It is not clear. And BTW in my experience stock VMware Tools in VMware 7.0.1 used to work perfectly before the latest glibc upgrade.



It was like that, but that could be and old VMware ESX server and could have older tools.

```
# ln -s /lib/libc.so.7 /lib/libc.so.6
```



			
				itsbrad212 said:
			
		

> I've always found QEMU to do the job.


QEMU is too slow for that, its nice for running an OS which need other ARCH then the host system, or for debugging, but for virtualization, even with kqemu its still too slow.



			
				DrJ said:
			
		

> My guess is that VBox cleaned up the ousy I/O interfaces and kept the core computational part, which is pretty decent.  That's what it needed.
> 
> Right now VMware does not do what I need.  *argh!*


So what are pending problems in that thread, cause I got little confused?


----------



## DrJ (Jul 6, 2010)

vermaden said:
			
		

> So what are pending problems in that thread, cause I got little confused?



Fair enough.  I'd like to get a reasonable desktop version of FreeBSD set up in a VM.  Part of that is to keep potentially dangerous web viewing off the Windows box, so I'd like all of the multimedia stuff to work.  Of course access to the various tools is another driver, as I have over 5GB of proposals written in troff and BSD is wired into my fingers.

Right now, Player 3.1 works, but the open-source tools does not give me working sound.  Player 3.0.1 with the VMware tools works (including sound), but Flash videos lock up every time.  

I'd like to get something that works.  Piggy claims to have 3.1 working completely, and I'd like to explore that.  Otherwise I may have to look at VBox.  There don't seem to be any other options that I can tell.


----------



## piggy (Jul 6, 2010)

DrJ said:
			
		

> Just curious, piggy, what versions of the linuxator and flash are you using?  I'm using linux_base-f10-10_2 and linux-f10-flashplugin-10.0r45.  I don't think that Gnome vs. KDE should make a difference.  I do notice that there is a large version difference between the open-vm-tools that is current and that I tried.  I'd bet that is the difference.




```
linux-f10-flashplugin-10.1r53
linux_base-f10-10_2
```
Imho, there is no comparision between VMware and any other virtualization software. Just VirtualPC (I've been able running Freebsd under it ) and VirtualBOX can be partitally compared. Others are limited solutions.


----------



## DrJ (Jul 6, 2010)

piggy said:
			
		

> linux-f10-flashplugin-10.1r53
> linux_base-f10-10_2


OK, so a slight difference in the flash version.


> Imho, there is no comparision between VMware and any other virtualization software. Just VirtualPC (I've been able running Freebsd under it  and VirtualBOX can be partitally compared. Others are limited solutions.


VBox is the only competitor as far as I can tell.  I'm starting to do some benchmarking with a colleague in NY, but Player can be pretty peppy.  I've compiled a standard 32-bit world with -j6 (4 cores active) in a bit under 18 minutes.  That's damed fast, and pretty near native speed.


----------



## vermaden (Jul 7, 2010)

@DrJ

You seem to have some aversion to VirtualBox? 

I used it on Linux and on FreeBSD and even on OpenSolaris and it always worked well, I am even able to play Baldur's Gate II under VirtualBox.

... as for Flash (no matter if i386/amd64) I use it that way:

```
% cat misc/freebsd/flash10 
/etc/rc.conf
  linux_enable="YES"

/etc/fstab
  linproc  /usr/compat/linux/proc  linprocfs  rw  0  0

# pkg_add -r linux_base-f10
# pkg_add -r nspluginwrapper
# pkg_add -r firefox35
# pkg_add -r linux-f10-nspr
# pkg_add -r linux-f10-sqlite3
# pkg_add -r linux-f10-curl
# pkg_add -r linux-f10-libssh2
# pkg_add -r linux-f10-nss
# mount linproc
# /etc/rc.d/abi restart
# /etc/rc.d/sysctl restart
# cd /usr/ports/www/linux-f10-flashplugin10 && make install clean

% find / -name libflashplayer.so
    /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so
% nspluginwrapper -v -i /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so
```

Sometimes its also a must to [font="Courier New"]*% cp /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so ~/.mozilla/plugins*[/font]


----------



## DrJ (Jul 7, 2010)

vermaden said:
			
		

> You seem to have some aversion to VirtualBox?


Not really, but I have had good luck with VMware in the past.  And I don't have a lot of time to diddle with this at the moment, so it will have to wait.

I have no trouble setting up Flash or the rest of FreeBSD, other than some weirdnesses such as java not working with FF 3.6.x.  It all works fine on a native install.  The issue is the VM.

I will try VBox, but probably this weekend.  I simply can't get VMware to work for me.


----------



## vermaden (Jul 7, 2010)

DrJ said:
			
		

> I will try VBox, but probably this weekend.  I simply can't get VMware to work for me.



The only versions of VMware that I used recently were only ESX 3.5 and 4.0 (aka VMware vSphere), so my knowledge would rarher not help You here


----------



## phoenix (Jul 7, 2010)

DrJ said:
			
		

> I have no trouble setting up Flash or the rest of FreeBSD, other than some weirdnesses such as java not working with FF 3.6.x.



It's not wierdness, it's a known-issue.  They (Mozilla devs) changed the plugin API in Firefox 3.6, requiring an updated JRE plugin which was released with Sun JRE 6 update 19 (or 17?).

IOW, if you want a Java plugin in Firefox 3.6, you need a newer version of Java.  Doesn't matter what OS you use, this is how things are.

Unfortunately, FreeBSD's latest Java 1.6 JRE is 6 update 7.  Thus, if you want Java in Firefox on FreeBSD, you need to stick with FF 3.5.


----------



## DrJ (Jul 7, 2010)

phoenix said:
			
		

> It's not wierdness, it's a known-issue.


I know, Phoenix, but you have to keep up with the details of FreeBSD to find that out.  It makes it really time-consuming to use.


----------



## phoenix (Jul 7, 2010)

The underlying issue has nothing to do with FreeBSD.  It affects every OS that Firefox 3.5 and 3.6 run on.

The only FreeBSD bit is the lack of an updated Java plugin.


----------



## adamk (Jul 8, 2010)

Seriously, he never said the underlying issue has to do with FreeBSD.  The fact of the matter is that when a user installs FreeBSD, updates to the latest ports, installs firefox and then java, they can spend a serious amount of time trying to get the plugin working before discovering what the problem is.  You say it's a "known issue" but it's only known if you've encountered it and start researching it.

Adam


----------



## DrJ (Jul 9, 2010)

vermaden,  I installed VBox on Win7 and installed FreeBSD/X11/Gnome/Java/Linux/Flash and the guest additions.  First the positive: sound and flash videos do work.  The negative is that it is so slow that it is barely usable.  I *think* I set it up properly, with the guest additions (including the rc.conf line), and the modification to xorg.conf for the video driver (the vbox mouse driver did not work for me, even with the HAL code).  Even the console feels turgid.

Maybe it works better on *nix than on Windows?  Or there was a setup option I missed?


----------



## DrJ (Jul 9, 2010)

I diddled with the VBox settings a bit, and now it works OK.  Not as snappy as Player, but at least everything works properly.  I'll play with it for a bit to see if there are major issues.  Already it has not shutdown properly a couple of times, requiring a fsck upon rebooting.  Weird.


----------



## vermaden (Jul 10, 2010)

DrJ said:
			
		

> vermaden,  I installed VBox on Win7 and installed FreeBSD/X11/Gnome/Java/Linux/Flash and the guest additions.  First the positive: sound and flash videos do work.  The negative is that it is so slow that it is barely usable.  I *think* I set it up properly, with the guest additions (including the rc.conf line), and the modification to xorg.conf for the video driver (the vbox mouse driver did not work for me, even with the HAL code).  Even the console feels turgid.



I used it mostly 'the other way' with FreeBSD as a host system and various Windows/Linux/OpenSolaris guests (and that worked well).

Dunno how GNOME 'feels' about it, but I would try WITHOUT hald (but WITH dbus), to see if there is any improovement, personally I never use hald, and do not even enable dbus (it engages itself if its needed by some application), but I do not use full featured desktop environment, but only an OPENBOX window manager with apps that I need.

I mostly run text/terminal/server like FreeBSD under VirtualBox or only with very basic window manager, never tried to setup there a full DE or flash/java ... but as You say that there are some issues, I will try to check if I can fix some of them.



			
				DrJ said:
			
		

> Maybe it works better on *nix than on Windows?  Or there was a setup option I missed?



I always enable all 'accelration' options, like AMD-V/Intel VT-x, Nested Pages, I/O APIC, PAE/NX and 3D for graphocs if it will be 'desktop like' system.


----------



## DrJ (Jul 10, 2010)

I think you are right about HAL, but Gnome depends on it pretty heavily.  The reason I say this is that I came to the computer this morning, and the vbox window had frozen solid.  A hard reboot later (and a manual fsck -- the file system claimed it was clean) xorg now freezes when loaded.  And it locks the entire VM.

When it runs, though, the console is much, much quicker than it was before.  So something changed, but I'm not sure what.  lshal still displays its devices, and the expected daemons are running.  Weird.  I'm reinstalling xorg to see if something got corrupted.


----------

