Comments (6)
A couple of things that might help:
- The root snapshot was taken with 1G of RAM, so you'll have to use that for our snapshot:
https://github.com/panda-re/panda_image_generator/blob/master/make_image.py#49
https://panda.re/frame.php?url=/qcows/
so the panda command becomes:
panda-system-x86_64 -m 1G ~/.panda/bionic-server-cloudimg-amd64-noaslr-nokaslr.qcow2 -nographic -net nic -net user,hostfwd=tcp::8888-:8888 -loadvm root
Otherwise, you'll get those messages and hanging behavior you see above when running with -loadvm root
- You might have to grab a new ip. For me, just running
dhclient
in the guest did the trick:
root@ubuntu:~# dhclient ens3
cmp: EOF on /tmp/tmp.2Dd5p6Bq1V which is empty
root@ubuntu:~# ifconfig ens3
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::5054:ff:fe12:3456 prefixlen 64 scopeid 0x20<link>
inet6 fec0::5054:ff:fe12:3456 prefixlen 64 scopeid 0x40<site>
ether 52:54:00:12:34:56 txqueuelen 1000 (Ethernet)
RX packets 42 bytes 9366 (9.3 KB)
RX errors 17 dropped 0 overruns 0 frame 17
TX packets 40 bytes 4273 (4.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
After those two things, the netcat test passes:
#GUEST
root@ubuntu:~# nc -lnvp 8888
Listening on [0.0.0.0] (family 0, port 8888)
Connection from 10.0.2.2 44314 received!
aaaa
#HOST
root@430045c1f0b6:/# nc localhost 8888
aaaa
from panda.
We haven't messed with the standard qemu networking so those options should work. Can you provide an example pypanda script showing how you were adding them to extra args?
from panda.
Taking the following code as an example, I try to forward port 22 of the virtual machine to port 2222 of the host.
from pandare import Panda
panda = Panda(generic='x86_64_ubuntu_1804', extra_args='-net nic -net user,hostfwd=tcp::2222-:22')
@panda.queue_blocking
def run_cmd():
print('==========================================================================')
panda.revert_sync("root")
print('Starting....')
print(panda.run_serial_cmd("uname -a && ifconfig -a"))
print(panda.run_serial_cmd("netstat -antp"))
panda.run()
Then I execute in the host:
ssh [email protected] -p 2222
And got no response.
from panda.
Hm, it looks like you're passing the args right. The first thing that might be the issue is that the snapshot you're restoring to was probably taken without those network arguments which might cause a problem, I'm not positive if qemu allows you do change the nic forwarding args when loading a snapshot, but it didn't give you an error so maybe it's allowed. If you run the guest interactively on the command line instead of with pypanda, do you see anything differet?
panda-system-x86_64 ~/.panda/bionic-server-cloudimg-amd64-noaslr-nokaslr.qcow2 -nographic -net nic -net user,hostfwd=tcp::2222-:22 -loadvm root
See if that works, or even drop the -loadvm root
and wait for the guest to boot, then test it?
Also are you sure an ssh server is running inside the guest? Might be worth running netcat in the guest listening on port 22 to see if any traffic shows up
from panda.
If I run the following command I get an error.
panda-system-x86_64 ~/.panda/bionic-server-cloudimg-amd64-noaslr-nokaslr.qcow2 -nographic -net nic -net user,hostfwd=tcp::8888-:8888 -loadvm root
If I remove -loadvm root
it works fine. I transferred port 8888 of the virtual machine to port 8888 of the host, and used nc to send data, but still did not get any response.
from panda.
Thank you so much guys, my problem was solved very well!
from panda.
Related Issues (20)
- dump-guest-memory with paging is broken
- OSI_Linux Assertion `can_read_current(cpu) && "Couldn't find current task struct at first syscall"' failed. HOT 2
- Record replay breaks with virtio
- Invalid path in pandare.qcows HOT 2
- Rewrite panda_expect.py
- Wrong Repo
- Windows osi: program name resolution broken on current dev tree HOT 1
- gdb plugin: Remote communication error. Target disconnected.: Connection reset by peer. HOT 1
- memorymap: parameters look like ranges instead of lists
- Definitive command line args to get networking 'working' with docker container. HOT 2
- crash on memory-read in syscalls_logger pandalog_write_entry HOT 1
- How can I use panda to interact with a program. HOT 3
- race condition in python callback function? HOT 2
- some suggestions
- How to get the number of instructions in a replay file in Python Panda? HOT 1
- "ValueError: Unsupported ANSI command ?" in pandare/panda_expect.py
- COSI error loading profile HOT 8
- Bump container to 22.04
- Protobuf files need to be regenerated for protoc versions > 3.19 HOT 2
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 panda.