Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to socksify a qemu-kvm using tsocks, but I have no success.

I don't know if qemu access directly the hardware, skipping the OS or something like that, but I wasn't able to do this feat.

I need a solution which socksify the kvm on host machine. Do you know guys if it's possible or I have to use another software/addon to work on it?

share|improve this question
Which network setting are you using for qemu? -net user, -net tap, -net bridge, ... ? – jofel Oct 14 '13 at 15:14
this has been already asked a couple of times for kvm and qemu, with no answer. – user55518 Jul 2 '14 at 12:57

It's a year-old subject, but someone may be still interested...

I can confirm that qemu-kvm can be successfully wrapped with tsocks relay, using ssh SOCKS proxy. For DNS, ttdns is run on the host OS, so incoming UDP-DNS request from guest OS/qemu-kvm is converted to TCP-DNS request, and then relayed over tsocks+ssh.

Actual command-line used:

# env -i tsocks qemu-system-x86_64 --enable-kvm \
-drive file=<snip>,cache=none,aio=native,if=virtio \
-net nic,model=virtio -net user -nographic -serial mon:stdio

Just to check, I monitored interfaces on the host while using HTTP/DNS on the guest (for "yum upgrade"), and no packet went through except on port 22.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.