LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-11-2007, 11:24 AM   #1
Fill
Member
 
Registered: Jun 2007
Posts: 96

Rep: Reputation: 16
Qemu with internet...


I've been looking for help about mounting internet on my virtual windows machine that runs under qemu.

I caught this under linuxquestions:

Quote:
Now that Windows is installed, you need to get internet working. It autoconfigures its NIC with a virtual dhcp server with the IP of 10.0.2.5. You need to allow packet flow of that DHCP server, so I put these rules in my iptables config:
Code:
iptables -A FORWARD -d $IP_FROM_CLIENT_OS -j ACCEPT
iptables -A FORWARD -s $IP_FROM_CLIENT_OS -j ACCEPT
$IP_FROM_CLIENT_OS was set to the virtual dhcp server's ip: 10.0.2.5

You'll need to make sure you have the tun/tap kernel module installed. It was, in my kernel, installed as a module by default. So all I had to do was:
Code:
modprobe tun
You now have a /dev/net/tun device, and should have internet.

After that, I reloaded the image.
How do I edit that iptables? I know it is in /sbin/ifconfig, am I right?

Yeah, but when I open it with gedit text editor, I get a message saying that he's uncapable of reading the text codification. How can I edit it?
 
Old 07-12-2007, 04:22 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Ummm ... how iptables is handled depends largely on your
distro, as does the way networking between QEMU VMs and
their host is done in general. Shed some light in regards
to your distro, and maybe people can make targeted suggestions.

[edit]
Oh, and in NO distro do you want to edit a binary with a
text editor... IP tables rules are commonly modified with
shell scripts, and again the how depends on your distro...
[/edit]

Cheers,
Tink

Last edited by Tinkster; 07-12-2007 at 04:23 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use Qemu altella Mandriva 1 04-12-2006 07:55 PM
DISCUSSION: Slackware/Qemu with internet HOW-TO scuzzman LinuxAnswers Discussion 0 02-25-2006 06:59 PM
qemu paul_mat Linux - General 3 12-09-2005 12:48 PM
qemu RySk8er30 Linux - Software 1 06-01-2005 07:23 PM
qemu: qemu stopped right after command exec bitpicker Linux - Software 1 03-04-2005 11:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration