3

My VM (Ubuntu Vagrant VM) is extremely slow. While my Windows co-workers have a maximum of 1 minute page load time, my page load takes up to 8 minutes.

I tried putting log files in non shared folders—no Effect. I tried fiddling with the VirtualBox settings, but I do not know what I am doing there.

It really got worse with the Mavericks Update.

Anyone any ideas?

My System:

  • MacBookPro 2.53GHz Core2Duo
  • 8GB-RAM
  • 512MB SSD

My VirtualBox (4.2.22) Settings:

  • CPU 1 Core
  • RAM 2048MB
  • Hardware Acceleration enabled (VT-x/AMD-V)
  • Nested Packaging enabled

Due to a shared Vagrant file, the Windows user have the same VirtualBox settings.


LATE UPDATE: The Improvements that worked so far

After i had switched Laptops, now i am back to working with a VM on my Mac so i got back to this Topic.

SFTP Sync via IDE instead of SMB or Shared Folders I stopped using shared Folders and instead i let my IDE (PHP Storm) sync the Files to teh VM via SFTP. So i am working in a local directory and the VM get's the files via SFTP Sync. This was a huge Improvement.

The Adjustment of the Cores helped a tiny bit See Answer by @zigg.

Changed Drive Setting to SSD in VM wich helped a tiny bit See Answer by @IljaPavkovic.

1
  • What about the VM disk size ? Commented Oct 27, 2014 at 9:12

5 Answers 5

7

try enabling SSD on the virtual drive. This helped in my environment.

As I cannot answer to comments:

  • settings->storage
  • mark hard disk
  • click "Solid-State Drive"
0
3

Don't use shared folders. Mount a Samba folder from your host machine to access/edit your source. It is way faster.

2

Your performance hit could be that you're running a four-core VM on a dual-core machine.

The VirtualBox manual says:

On the "Processor" tab, you can set how many virtual CPU cores the guest operating systems should see. Starting with version 3.0, VirtualBox supports symmetrical multiprocessing (SMP) and can present up to 32 virtual CPU cores to each virtual machine.

You should not, however, configure virtual machines to use more CPU cores than you have available physically (real cores, no hyperthreads).

Try reducing the cores in your VM and see if that helps your problem. If it does, the Vagrant configuration will likely also have to be updated.

1
  • Thanks, I tryed that and i have founbd that answer in my research as well. Sadly it was not the cause :( Commented Jan 27, 2014 at 9:33
1

If you have some process inside the VirtualBox virtual machine that accesses shared folders frequently (perhaps polling some file for changes), that could degrade performance considerably due to the VirtualBox shared folder implementation.

The Vagrant documentation says: "In some cases the default shared folder implementations (such as VirtualBox shared folders) have high performance penalties. If you're seeing less than ideal performance with synced folders, NFS can offer a solution. Vagrant has built-in support to orchestrate the configuration of the NFS server on the host and guest for you."

In this case it might be worth trying out Vagrant's NFS-based synced folders instead.

1
  • Sadly i can't test this anymore since i left the project and therefore had to leave the computer behind as well :-( Commented Aug 25, 2014 at 8:16
1

Just to let you know, that if the NFS shares with Vagrant are still too slow for you, you can do the contrary : instead of installing a NFS server on your host machine, you can install it on the VM guest : http://guillaumeduveau.com/en/drupal-lightning-fast-synced-folders-in-vagrant-virtualbox/

3
  • Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone.
    – nohillside
    Commented Jan 27, 2017 at 8:02
  • 1) in Vagrantfile don't configure any config.vm.synced_folder - but add a private network : config.vm.network "private_network", ip: "192.168.54.12" 2) in your guest, install nfs-kernel-server, add this to /etc/exports : /var/www/your_web_folder 192.168.54.1(insecure,rw,all_squash,anonuid=1000,anongid=1000) 3) in your guest, restart nfs-kernel-server, on Debian/Ubuntu : sudo service nfs-kernel-server restart 4) in your host, create a directory somewhere else than in your VM dir, like www 5) in your host, mount the dir : mount -t nfs 192.168.54.12:/var/www/your_web_folder www Commented Jan 28, 2017 at 22:53
  • Can you please edit this directly into your answer?
    – nohillside
    Commented Jan 29, 2017 at 7:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .