I doubt very much that the error is related to the virtual machine.
I think it depends on how you #include your ip.h: if you write #include "ip.h"
(note the double quotes), then you make the compiler to look for 'ip.h' located in the same directory as the .c file. It's implementation-defined whether the compiler would continue searching among the system headers. Since you are most likely trying to include a system-wide ip.h
and not your own IP-related header file, you should include it with angle brackets (and with the correct relative path): #include <linux/ip.h>
.