KiCad in a VM - Page 1
Forum section: electronics / general

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 25, 2016, 12:01:11 am
content: Is anybody else doing this? I've found that building KiCad from scratch is such a PITA on most Linux distros, that it's better to simply use a VM running one of the few distros on which KiCad builds properly rather than having to switch the host OS. I've been running into some annoying problems with that though.The first is that in VirtualBox the mouse lags horribly, it's almost unusable. I found this which describes the issue:https://gist.github.com/tomacorp/80943ef136e37823db42However the fix to shut off EXAPixmaps does not work for meI then switched to VMWare, and while the mouse problem is gone, there's a new problem. Whenever I select a group of components in either eeschema or pcbnew, the screen does not auto-refresh. One or two components works fine, but 5+ gets no refresh. I have to keep banging F3 as I drag the group around in order to see where it's currently at so I can drop it in the right place.I do have a laptop running OpenSUSE Tumbleweed as the host with the same version of KiCad installed natively, and it doesn't have any of these problems, so it has to be the virtualization software.

author: timofonic
author_rank: Frequent Contributor
timestamp: February 25, 2016, 12:23:39 am
content: I use both Archlinux's AUR and Gentoo/Funtoo. Zero issues. What distro do you use?I suposse Vmware is installed with the guest stuff and such. Am I right?Maybe a developer can read this. If not, I can send it to one. You can ask in the kicad-developers mailing list too.https://lists.launchpad.net/kicad-developers/

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 25, 2016, 01:02:47 am
content: Lots of distros at play here, let's see...OpenSUSE Tumbleweed -> KiCad (running natively) = no problemsCentOS 6 -> VirtualBox -> Debian Unstable -> KiCad = laggy mouseCentOS 7 -> VirtualBox -> OpenSUSE Tumbleweed -> KiCad = laggy mouseCentOS 7 -> VMWare -> OpenSUSE Tumbleweed -> KiCad = no refresh when moving selectionand the link I posted, if you want to include it:OSX -> VirtualBox -> Ubuntu 14.04 -> KiCad = laggy mouseAll systems and VM software up to date, guest additions installed, etc.I'll try the mailing list if nobody here has run into this problem and has a suggested work-around.

author: daybyter
author_rank: Frequent Contributor
timestamp: February 25, 2016, 01:39:19 am
content: I use a kubuntu host and mostly Debian guests for development. Due to some network issues, I also use kvm+qemu for some apps.

author: eugenenine
author_rank: Frequent Contributor
timestamp: February 25, 2016, 03:06:51 am
content: What OS for the host?I found the Kicad build pretty simple, if you want to see complex try something like mySQLWorkbench.https://slackbuilds.org/result/?search=kicad&sv=14.1

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 25, 2016, 03:27:45 am
content: Host OSs are in post #3The build is simple if you're on one of the few distros which provide the necessary dependencies. On any of the vast multitude of other distros you quickly run into dependency hell. Try building it on Debian Stable, RHEL, CentOS, or any other server/stable distro, it's not exactly fun.That's not really the point of this post anyway though, the point is the behavior under virtualization. Both VirtualBox and VMWare appear to be having problems, but very different ones. It's pretty clear to me that the laggy mouse problem is solely due to VirtualBox's interaction with KiCad. I'm not sure yet about VMWare since I don't have a decent sample size.

author: eugenenine
author_rank: Frequent Contributor
timestamp: February 25, 2016, 03:47:04 am
content: Sorry, missed post 3 while I was typing. I did build it myself though, there were a whole 5 other packages I had to build, was pretty simple.

author: daybyter
author_rank: Frequent Contributor
timestamp: February 25, 2016, 06:11:03 am
content: What mouse capture strategy do you use?Is 2d acceleration enabled in your guest?Did you check the load of the machine with 'top' and added more RAM or CPU cores if necessary?

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 25, 2016, 04:54:13 pm
content: I've tried "PS/2 Mouse" and "USB Tablet" in VirtualBox, no difference.2D acceleration in VirtualBox is only for Windows guests, it won't let me set it. 3D acceleration causes several programs in the VM to seg fault, including the terminal emulator of all things...so I leave that off.CPU and RAM settings for the VM make no difference, it's not resource-limited. The standard setup is 2 cores and 2 GB, I bumped it up to 4 cores and 4 GB with no change. At idle the load is negligible on both the guest and host. When moving the mouse the guest jumps up to about 50% CPU for kicad and 30% for Xorg (out of 400% since there are 4 cores) and the host jumps up to about 120% for virtualbox and 40% for Xorg (again out of 400%).

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 25, 2016, 05:08:19 pm
content: Also let me clarify a bit what I mean by the mouse is laggy.In both eeschema and pcbnew, there are two pointers. There's the system mouse pointer, and below that are cross-hairs that move with the pointer but snap to the grid below. When I say the mouse lags, I'm referring to the cross-hairs only. The system pointer is fine, it moves like normal and there's no visible lag or other problems. The issue is the cross-hairs lag behind the pointer. It's not jumpy or erratic, it's just slow.It's as if whenever the mouse moves, the system pointer is filling up a buffer at 100 Hz, and kicad is pulling the positions out of that buffer at 50 Hz to update the cross-hair location. It eventually gets to the new location of the pointer, but it moves at half the speed and takes twice as long to get there. If you spin the mouse in circles for two seconds and then stop, the cross-hairs continue circling for an additional two seconds until they finally catch up to the final location of the pointer. And this issue is not present at all when running the same guest OS in VMWare (but VMWare has its own problems described above).

author: ve7xen
author_rank: Super Contributor
timestamp: February 25, 2016, 07:42:03 pm
content: I have no experience with running KiCad under VM, but the whole 2D drawing architecture seems poor. I've seen redraw issues on every hardware and software combination I've run it on; it seems to me just a fact of life using KiCad. I just got used to hitting the redraw hotkey to clean it up.Beyond that though, it has serious issues with performance on some graphics chipsets, and I suspect this is the root of the issues under virtualization. ATI cards running the open-source driver are very slow in eeschama and especially pcbnew (except the OpenGL mode which works fine). In my experience the suggested EXAPixamps fix is only partial and still results in quite poor performance. Apparently they are using some features of X that aren't accelerated/supported by all drivers, and don't seem to intend to change them. I would guess something similar might be true of the emulated graphics drivers - or the actual rendering methodology itself is just slow or requires a lot of interaction with the hardware, and virtualizing makes it slower.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 25, 2016, 07:58:22 pm
content: Quote from: ve7xen on February 25, 2016, 07:42:03 pmYou might be right. I just copied the VirtualBox VM over to a different machine and it doesn't appear to have any lag problems. It's a newer machine, a bit faster, but the main difference is it runs Intel HD graphics that are built into the processor, versus my primary machine which has an older NVIDIA Quadro card.

author: nickoe
author_rank: Contributor
timestamp: March 01, 2016, 09:08:55 pm
content: Quote from: suicidaleggroll on February 25, 2016, 01:02:47 amI don't see what the problem is. The main buildserver is centos6 and that it builds just fine...Quote from: suicidaleggroll on February 25, 2016, 03:27:45 amYou know that KiCad 4.0.2 should be available via backports in Debian Stable (Jessie)?