Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to build on Windows #4

Open
leonrinkel opened this issue Nov 27, 2019 · 13 comments
Open

Figure out how to build on Windows #4

leonrinkel opened this issue Nov 27, 2019 · 13 comments

Comments

@leonrinkel
Copy link
Contributor

Hi,
Tested xml thing. I guess it is works as expected.
I think i can create domain autostart method.
Also added setVcpu method to domain builder, i'm collecting PR request

By the way i'm looking for building and running package on windows but can't get how to link libvirt package to node-gyp :(

Tested VNC configuration. Fuck wow, it is actually simpliest and most usefull solution to manage VMs with typescript. vmngr/libvirt already better than any of existing bindings lmao

Originally posted by @libvirtadept in https://github.com/vmngr/libvirt/pull/3#issuecomment-558607434

@libvirtadept
Copy link
Contributor

libvirtadept commented Nov 27, 2019

In my case solved by switching to Ubuntu instead using 2nd PC with qemu software.
I guess it is better to develop and test on one machine instead 2 of them.

Whoops, forgot to say
With ubuntu it is just installing
sudo apt-get install libvirt-dev

@libvirtadept
Copy link
Contributor

Nah, ubuntu working is kinda shitty actually.
Trying to get it working on windows....
Each time showing that virt.lib not found (if specified in link_settings.libraries).
If not, it is showing LNK 2019 error (unresolved external symbol)

@libvirtadept
Copy link
Contributor

Hm. It's little bit confusing.
In windows without libraries settings it is returning a lot of
hypervisor-domain.obj : error LNK2001: unresolved external symbol virDomainGetID [C:\Users\admin\Desktop\libvirt-dev-xml\build\virt.vcxproj] errors

@leonrinkel
Copy link
Contributor Author

Ok I've had a look into it and I didn't even got close to getting it to work... How did you install the Windows-equivalent of libvirt-dev? Did you build it from source?

@libvirtadept
Copy link
Contributor

As I saw in Linux case it is adding header files in /usr/include (kind of)
I’ve downloaded source files from libvirt’s github and added “include” folder to included_dirs (binding.gyp). Note: libvirt-common.h here is named as libvirt-common.h.in.
I can create example repo if it will help

@libvirtadept
Copy link
Contributor

vcpkg and chocolatey doesn’t have libvirt-dev package
As I remember Cygwin have only old package named as libvirt-devel

@leonrinkel
Copy link
Contributor Author

That’s not gonna work, the .h.in files are header files that need some preprocessing. Building libvirt will produce the actual header and library files. There is a guide on how to compile it from source on Windows, but that requires even more other dependencies and ugh ... I’ll have a look into it tomorrow.

@libvirtadept
Copy link
Contributor

Oh
Didn’t knew about pre processing. Libvirt usage on windows is so problematic 😞

@leonrinkel
Copy link
Contributor Author

Ok I got it working with WSL. It's not 100% native Windows but it's way easier than anything else. Another easy workaround would be to use Docker.

@libvirtadept
Copy link
Contributor

libvirtadept commented Dec 6, 2019

Yeah, thought about building in wsl.
Other case if user developing under windows and downloading package from npm/github that's not gonna build.
In case of docker, yes there is will no troubles

@libvirtadept
Copy link
Contributor

I've make domiftune --current work
But virsh-way realisation needed a g_malloc0_n func from glib (idk what is actually). Replaced it with malloc and it is seems work, but not sure is it good approach
How you looking on requiring linking of glib-2.0 for build ?

image

@libvirtadept
Copy link
Contributor

libvirtadept commented Dec 6, 2019

@leonrinkel
Tested to develop inside WSL. Looks terrible. No autcomplete, no "go to definition", included paths are ignored

After some random clicks make it work. Oh that's feel. UI not laggin, switch between windows are so easy :)
Time to develop some features....

@dhirajtech86
Copy link

Guys I have installed QEMU on windows and now planning to try this package via WSL on the same system. can you guide me on how to do that? Is it even possible or not?

I have tried installing libvirt on WSL but not able to run its service (/var/run/libvirtd.pid: No such file or directory). Though libvirt-dev is installed.

Please suggest how to proceed further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants