Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optimizing the kernel for VMware
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
sinfidel
n00b
n00b


Joined: 08 Jun 2013
Posts: 3

PostPosted: Sat Jun 08, 2013 2:01 pm    Post subject: Optimizing the kernel for VMware Reply with quote

You can follow these configuration guidelines to optimize the kernel for vmware. Tested on both gentoo-sources and ck-sources.

Don't forget to do this!

Code:
[*] 64-bit kernel (leave blank for x86)

General Setup --->
  [*] Optimize very unlikely/likely branches

Processor type and features --->
  Processor Family (usually Core2/Newer Xeon)

Bus Options --->
  < > PCCard (PCMCIA/Cardbus) support

Networking support --->
  [ ] Amateur Radio support
  [ ] Wireless (only if you plan on using nat EXCLUSIVELY)

Device Drivers --->
  Generic Driver Options
    [*] Maintain a devtmpfs filesystem to mount at /dev

  Misc Devices --->
    [*] VMware Balloon Driver (manages memory between VM and host)
    [*] VMware VMCI Driver (Virtual Machine Communication Interface - low-latency access to host memory bus)

  SCSI device support --->
    [*] SCSI low-level drivers --->
      <*> VMware PVSCSI driver support (high throughput storage adapter)

  [*] Fusion MPT device support --->
    <*> Fusion MPT ScsiHost drivers for SPI

  [*] Network device support --->
    [*] Ethernet driver support --->
      (disable every driver but this)
      [*] AMD Devices
        <*> AMD PCNet32 PCI support
    [ ] Wireless LAN (ONLY if you disabled Wireless networking support above)
    < > VMware VMXNET3 ethernet driver (PCNet32 is more than enough for most use cases - enable this only if you have spare cpu cycles to burn)

  Graphics support --->
    <*> Direct Rendering Manager
    < > Intel 8xx/9xx/G3x/G4x/HD Graphics
    <*> DRM driver for VMware Virtual GPU
      [*] Enable framebuffer console support under vmwgfx by default
    <*> Support for frame buffer devices

    Console display driver support --->
      <*> Framebuffer Console support

  Sound card support --->
    <*> Advanced Linux Sound Architecture --->
      [*] PCI sound devices
        <*> (Creative) Ensoniq AudioPCI 1371/1373
        < > Intel HD Audio

  File systems --->
    (enable only those you anticipate using)
    <*> Second extended fs support
    <*> The Extended 4 (ext4) filesystem
    <*> XFS filesystem support
    <*> Btrfs filesystem Unstable disk format

    Pseudo filesystems --->
      [*] Tmpfs virtual memory file system support (former shm fs)
        [*] Tmpfs POSIX Access Control Lists


Last edited by sinfidel on Fri Jun 21, 2013 2:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Mon Jun 10, 2013 1:16 pm    Post subject: Reply with quote

Nice post, sinfidel.
Back to top
View user's profile Send private message
nendzd
n00b
n00b


Joined: 10 Apr 2006
Posts: 68

PostPosted: Fri Jun 14, 2013 12:52 pm    Post subject: Reply with quote

Just curious at the

[*] PCI sound devices
<*> (Creative) Ensoniq AudioPCI 1371/1373

part. Does VMWare emulate one of those or was that specific to your config?
Back to top
View user's profile Send private message
sinfidel
n00b
n00b


Joined: 08 Jun 2013
Posts: 3

PostPosted: Sun Jun 16, 2013 3:14 pm    Post subject: Reply with quote

VMware emulates AudioPCI 1371 by default. You can change this to realtek hd audio in the vmx file, but I'm not sure if there's any real benefit in doing so.
Back to top
View user's profile Send private message
temporary_user
n00b
n00b


Joined: 26 Aug 2012
Posts: 37

PostPosted: Thu Jun 20, 2013 11:13 pm    Post subject: Reply with quote

Is this useful only on guest machines, or on host too?
Back to top
View user's profile Send private message
sinfidel
n00b
n00b


Joined: 08 Jun 2013
Posts: 3

PostPosted: Fri Jun 21, 2013 1:23 pm    Post subject: Reply with quote

I forgot to mention that you'll need to edit your vmx to gain the full benefits of compiling your kernel with these drivers.
To enable VMCI, append vmci0.present = "TRUE" to your vmx file.

temporary_user, here's some information from the VMware site

ʘ wrote:
Without VMCI, virtual machines communicate with the host using the network layer. Using the network layer adds overhead to the communication. With VMCI communication overhead is minimal and different tasks that require that communication can be optimized.

Ϡ wrote:
The memory balloon driver (vmmemctl) collaborates with the server to reclaim pages that are considered least valuable by the guest operating system.
The driver uses a proprietary ballooning technique that provides predictable performance that closely matches the behavior of a native system under similar memory constraints. This technique increases or decreases memory pressure on the guest operating system, causing the guest to use its own native memory management algorithms. When memory is tight, the guest operating system determines which pages to reclaim and, if necessary, swaps them to its own virtual disk.

Ѫ wrote:
PVSCSI adapters are high-performance storage adapters that can result in greater throughput and lower CPU utilization. PVSCSI adapters are best suited for environments, especially SAN environments, where hardware or applications drive a very high amount of I/O throughput. PVSCSI adapters are not suited for DAS environments.
In other words, you don't need this if you're not using networked storage.

Ѯ wrote:
To configure an existing boot disk to use a PVSCSI adapter
  1. Create a new temporary 1GB disk(SCSI 1:0) and assign a new SCSI controller (default is LSI LOGIC SAS).
  2. Change the new SCSI controller to PVSCSI for the new SCSI controller.
  3. Click Change Type.
  4. Click VMware Paravirtual and click OK.
  5. Click OK to exit the Virtual Machine Properties dialog.
  6. Power on the virtual machine.
  7. Verify the new disk was found and is visible. This confirms the PVSCSI driver is now installed.
  8. Power off the virtual machine.
  9. Delete the temporary 1GB vmdk disk and associated controller(SCSI 1:0).
  10. Change the original SCSI controller(SCSI 0:X) to PVSCSI as detailed in Steps 3 to 5.
  11. Power on the virtual machine.
Back to top
View user's profile Send private message
shi^Yo
n00b
n00b


Joined: 22 Oct 2004
Posts: 9
Location: Cyprus

PostPosted: Wed Nov 06, 2013 9:02 pm    Post subject: Cant find VWARE_BALLOON Reply with quote

Hi, thanks for the post, very helpful.

I am looking for VMWARE_BALLOON on kernel 3.10.17 and I can't find it. Is it related to the fact that I have selected hardened server profile (profile 11)?

Code:
# cat . config | grep VMWARE
CONFIG_VMWARE_VMCI=y
CONFIG_VMWARE_PVSCSI=y


EDIT: My bad, forgot to set CONFIG_HYPERVISOR_GUEST=y
Back to top
View user's profile Send private message
chamawill
n00b
n00b


Joined: 09 Nov 2013
Posts: 1

PostPosted: Sat Nov 09, 2013 8:43 pm    Post subject: Reply with quote

The original post seems more geared up for ESX or Workstation.

Here's some notes for Gentoo on VMWare Fusion 6 Pro for Mac OS X 10.9 working out some of the kinks:

(Note this is a kernel 3.12 from kernel.org extracted to /usr/src and then symlinked to /usr/src/linux)

KERNEL CONFIG
Code:
emerge -av bc

make menuconfig

Device Drivers ---> Generic Driver Options ---> [*] Maintain a devtmpfs filesystem to mount at /dev
Device Drivers --->  Fusion MPT device support ---> <*>   Fusion MPT ScsiHost drivers for SPI
Device Drivers --->  Graphics support ---> <*> DRM driver for VMware Virtual GPU
Device Drivers --->  Graphics support --->  [*]   Enable framebuffer console under vmwgfx by default
Device Drivers --->  Sound card support ---> Advanced Linux Sound Architecture ---> PCI sound devices ---> <*>   (Creative) Ensoniq AudioPCI 1371/1373

make && make modules_install && make headers_install


INSTALLING TOOLS
Code:
mkdir /etc/rc{0..6}.d


RUNSCRIPT
Code:
nano -w /etc/init.d/vmware

#!/sbin/runscript

depend() {
   after logger
}

start () {
   ebegin "Starting VMware tools (hack)"
   /etc/init.d/vmware-tools start
   echo
   eend $?
}

stop () {
   ebegin "Stopping VMware tools (hack)"
   /etc/init.d/vmware-tools stop
   echo
   eend $?
}

chmod +x /etc/init.d/vmware

rc-update add vmware default


FOR POWER ON FAILURE
Code:
nano -w /sbin/ifup

/sbin/ifconfig $1 up

chmod +x /sbin/ifup
Back to top
View user's profile Send private message
noisebleed
Apprentice
Apprentice


Joined: 03 Oct 2006
Posts: 177
Location: Porto, Portugal

PostPosted: Thu Jan 02, 2014 4:35 pm    Post subject: Reply with quote

Great post sinfidel. Very appreciated.

Just a little note, I'm creating a new Gentoo VM on ESXi 5.1.0 and the network adapter uses the E1000 driver. So for everyone that added the PCNet32 and/or VMXNET3 modules and are still missing network interface(s) please make sure to add support for E1000.

Code:
[*] Network device support --->
    [*] Ethernet driver support --->
        [*]   Intel devices
            <M>     Intel(R) PRO/100+ support
            <M>     Intel(R) PRO/1000 Gigabit Ethernet support
            <M>     Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support

_________________
Please add [SOLVED] to the subject line if the posted issue is resolved.
Back to top
View user's profile Send private message
GenProm
Tux's lil' helper
Tux's lil' helper


Joined: 18 Aug 2011
Posts: 100
Location: Germany

PostPosted: Sun Jun 01, 2014 9:16 am    Post subject: Reply with quote

Hello Guys and Girls :-)

Thanks for the tipps.

Important tho:


For Kernel 3.12.x and probably onwards it is important to NOT set:

Code:

  Misc Devices --->
    [ ] VMware Balloon Driver (manages memory between VM and host)
    [ ] VMware VMCI Driver (Virtual Machine Communication Interface - low-latency access to host memory bus)


Otherwise the app-emulation/vmware-modules-279.2 will not compile with the kernel!
_________________
Thank you for your help.

Manuel
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1816
Location: PB, Germany

PostPosted: Wed Feb 18, 2015 8:47 am    Post subject: Reply with quote

Do virtualized kernels need to support things like CONFIG_CPU_FREQ or CONFIG_ACPI_PROCESSOR or even CONFIG_ACPI in general? I' ve taken a native kernel config and optimizing/minimizing for a VMware Workstation VM, so there may be lot of settings left which are not required on VMs.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
WWWW
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2014
Posts: 143

PostPosted: Sat Mar 28, 2015 7:36 pm    Post subject: Reply with quote

Massimo B. wrote:
Do virtualized kernels need to support things like CONFIG_CPU_FREQ or CONFIG_ACPI_PROCESSOR or even CONFIG_ACPI in general? I' ve taken a native kernel config and optimizing/minimizing for a VMware Workstation VM, so there may be lot of settings left which are not required on VMs.


Good question. I would like to know this as well.

A while back I tried to build a VM machine with the absolute least bloat possible, but I can't recall now everything in detail.

I think ACPI manages power schemes for physical devices at least in qemu since many devices are managed by virtio drivers I am not sure how these interact.

Still is a tricky question, some VM machines use no physical devices, some do like VGA, Ethernet, usb passthrough etc.

These are all tied to ACPI for power management.

If anyone could elaborate more on this?

thanks.
Back to top
View user's profile Send private message
zhak
n00b
n00b


Joined: 04 May 2015
Posts: 21

PostPosted: Mon May 04, 2015 4:52 pm    Post subject: Reply with quote

Very useful tips. Thanks.
But I've got one more question on the subject:

I'm configuring kernel 4.0.1 for vmware workstation 11 (64-bit) and not sure about whether

Processor type and features --->
[ ] Linux guest support --->
[ ] Enable paravirtualization code

features should be enabled or not.

Description for 'Linux guest support' feature itself says, that it should be enabled for basic hypervisor detection and platform setup. But enabling 'Enable paravirtualization code' feature opens additional options for Type-1 hypervisors. Specifically, Xen and KVM. Nothing about VMWare WS

Do I need to enable this or not? How could either choice affect the system?
Thanks in advance!
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Tue Jun 20, 2017 8:03 am    Post subject: Reply with quote

Hi guys, just to follow this thread.

I am now on kernel 4.11.4 and pulled in workstation from vmware overlay (the standard vmware-modules from Gentoo tree didn't work) and here is my kernel config:
https://pastebin.com/sxiNJj2f

It is Dell XPS 15 9550 laptop compatible kernel started via UEFI, not grub or lilo needed. I am running without issues following apps from app-emulation:
Code:
*  app-emulation/vmware-modules
      Latest version available: 308.5.6
      Latest version installed: 308.5.6
      Size of files: 0 KiB
      Homepage:      http://www.vmware.com/
      Description:   VMware kernel modules
      License:       GPL-2

*  app-emulation/vmware-tools
      Latest version available: 9.9.4.3206955
      Latest version installed: 9.9.4.3206955
      Size of files: 0 KiB
      Homepage:      http://www.vmware.com/products/player/
      Description:   VMware Tools for guest operating systems
      License:       vmware

*  app-emulation/vmware-workstation
      Latest version available: 12.5.6.5528349
      Latest version installed: 12.5.6.5528349
      Size of files: 161,854 KiB
      Homepage:      http://www.vmware.com/products/workstation/
      Description:   Emulate a complete PC without the performance overhead of most emulators
      License:       vmware GPL-2 GPL-3


Entries in /etc/conf.d/modules:
Code:
# VirtualBox and VmWare
modules="vboxdrv vboxnetadp vboxnetflt vboxpci vmnet vmci vmmon"

_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
Dominus_Gentoo
n00b
n00b


Joined: 14 Jun 2005
Posts: 17
Location: Europe/Austria

PostPosted: Tue Sep 05, 2017 10:04 am    Post subject: OpenVMTools 10.1+ Reply with quote

LTS Kernel 4.9+

Add:
http://cateee.net/lkddb/web-lkddb/VMWARE_VMCI_VSOCKETS.html
→ Networking support → Networking Options → Virtual Socket Protocol
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum