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
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2692
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: 92
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
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