Comments (10)
You need the libvirt-python package.
from libvirt-hook-qemu.
I guess you mean python-libvirt, right? I had that installed already
dpkg -s python-libvirt
Package: python-libvirt
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 2177
Maintainer: Debian Libvirt Maintainers [email protected]
Architecture: amd64
Source: libvirt
Version: 0.9.12.3-1+deb7u1
Provides: python2.6-libvirt, python2.7-libvirt
from libvirt-hook-qemu.
First error is because you didn't pass all the argument on the command-line (as libvirtd would) and the hook's code failed to validate that before unpacking.
Second error is because it's trying to import the hook's code as a python module. ln -s qemu qemu.py
and try again please.
from libvirt-hook-qemu.
Yeah, well, that makes sense now that you say it ;)
linking qemu.py to qemu and starting test_qemu.py again finishes without any error, or any other message for that matter.
I tried to lookup the arguments that qemu passes on and I thought this is what the arguments should look like, but that also fails.
./qemu debian7 prepare begin -
Unfortunately the libvirt.log only states:
Hook script /etc/libvirt/hooks/qemu qemu failed with error code 256
My understanding was the exit code of the hook script != 0 wil result in error code 256 with the output of stderr, but there is no additional information that indicates what is wrong. Btw. this is how the qemu.json file looks:
{
"debian7": {
"interface": "virbr0",
"private_ip": "192.168.122.216",
"port_map": {
"tcp": [[2222, 22]]
}
}
hhttps://www.libvirt.org/hooks.html#structure
from libvirt-hook-qemu.
You might be missing an extra "}" at the end. I usually like to run my json files through jq: cat file.son | jq '.'
from libvirt-hook-qemu.
sigh
Sorry that I wasted your time with this nonsense, of course I was missing an extra } at the end. Thanks for your help.
Although the machine starts up and I can see the iptable rules, the port forwarding still isn't working, which is the same issue I had with the other solutions that you can find on the internet. Damn it...
from libvirt-hook-qemu.
No worries! I got it to work here pretty much painlessly (for a change). My setup was using a single bridge, where I got the public IPs (actually, my lab's private IPs) and from there it would forward to the VM. It might be worth running tcpdump on the bridge interface and inside the guests to see what's arriving (and if the packets are mangled or not).
from libvirt-hook-qemu.
[root@CentOS-71-64-minimal hooks]# virsh start Guest --console
error: Failed to start domain Guest
error: Hook script execution failed: internal error: Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin /etc/libvirt/hooks/qemu StageMain prepare begin -) unexpected exit status 1: Traceback (most recent call last):
File "/etc/libvirt/hooks/qemu", line 97, in
domain = config().get(vir_domain)
File "/etc/libvirt/hooks/qemu", line 51, in config
config._conf = json.load(f)
File "/usr/lib64/python2.7/json/init.py", line 290, in load
**kw)
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 381, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 7 column 8 (char 115)
from libvirt-hook-qemu.
Just filed a PR that addresses the unit test part of this issue: https://github.com/saschpe/libvirt-hook-qemu/pull/6/files
Yes, running the test script should produce output:
----------------------------------------------------------------------
Ran 3 tests in 0.026s
OK
If not, the tests didn't run.
@extr3mal it looks like you have an error in your JSON file (or did, 6 months ago...)
from libvirt-hook-qemu.
#6 is in. @hillbicks, is there anything more that needs to be done to address this PR?
from libvirt-hook-qemu.
Related Issues (15)
- Use Range port HOT 4
- Port forwarding for a specific iface HOT 2
- make clean fails on Ubuntu 16.04
- Can't reach services from other host. HOT 1
- No port forward rules in iptables HOT 1
- Cannot find qemu.json. HOT 2
- ips seem to be added wrongly HOT 1
- 18.04? HOT 1
- Allow commenting in config file? HOT 3
- Multiple network interfaces for a vhost? HOT 4
- LICENSE.txt (or LICENSE.md) file is missing, is it intended? HOT 1
- validator fails for port_range unless port_map is also defined
- feature request: support for ipv6 DNAT
- Allow single port integer instead of port pairs?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libvirt-hook-qemu.