Comments (4)
Why are you using workstation? Just use panda/qemu/kvm with the original qcow. You can install software into the qcow filesystem as needed. You can't take a snapshot with qemu/kvm that can then be loaded into panda, but after modifying the filesystem with qemu/kvm you can boot it under panda and then take a new snapshot.
Also try interacting with your guest instead of using the python interface, it's likely printing something other than a PS1 style prompt via the serial console which is causing your exception. You can run python3 -m pandare.qcows x86_64
to get a command that you can use to launch the generic x86_64 images interactively.
from panda.
Why are you using workstation? Just use panda/qemu/kvm with the original qcow. You can install software into the qcow filesystem as needed. You can't take a snapshot with qemu/kvm that can then be loaded into panda, but after modifying the filesystem with qemu/kvm you can boot it under panda and then take a new snapshot.
Also try interacting with your guest instead of using the python interface, it's likely printing something other than a PS1 style prompt via the serial console which is causing your exception. You can run
python3 -m pandare.qcows x86_64
to get a command that you can use to launch the generic x86_64 images interactively.
I'm just an undergraduate student majoring in Computer Science and Technology who use Panda for my undergraduate project. I'm not very familiar with this field. That's why I was using workstation(It's very stupid).
I followed your guidance to boot the original image using Panda (specifically, ./panda/bionic-server-cloudimg-amd64-noaslr-nokaslr.qcow2), then enabled networking, and installed software (i.e., modified the file system). After that, I rebooted this qcow2 under Panda and took a new snapshot named "root." However, it seems that this snapshot cannot be used with PyPanda.
What issues might there be with my steps?
Here are my steps:
- Boot the original qcow2 using Panda:
./panda-system-x86_64 -hda ~/.panda/bionic-server-cloudimg-amd64-noaslr-nokaslr.qcow2 -nographic -m 1G
- Enable networking and installe software (i.e., modify the file system).
- Reboot the system and take a new snapshot at the login page using the QEMU monitor: (qemu) savevm root
Then, I wrote a short Python code to test if the new snapshot is usable, and PyPanda threw a timeout exception.
I think my code is correct, it's very simple:
from pandare import Panda
panda = Panda(generic="x86_64")
@panda.queue_blocking
def run_cmd():
# First revert to root snapshot, then type a command via serial
panda.revert_sync("root")
print(panda.run_serial_cmd("ls"))
panda.end_analysis()
panda.run()
but I got the exception:
PANDA[core]:os_familyno=2 bits=64 os_details=ubuntu:4.15.0-72-generic-noaslr-nokaslr
[PYPANDA] Panda args: [/usr/local/build/x86_64-softmmu/libpanda-x86_64.so -L /usr/local/build/pc-bios /home/jyq/.panda/bionic-server-cloudimg-amd64-noaslr-nokaslr.qcow2 -display none -m 1024 -serial unix:/tmp/pypanda_s3loy_jeb,server,nowait -monitor unix:/tmp/pypanda_m93csxqt4,server,nowait]
Traceback (most recent call last):
File "/home/jyq/PyPandaCode/run_cmd.py", line 25, in
panda.run()
File "/usr/local/lib/python3.10/dist-packages/pandare/panda.py", line 555, in run
raise saved_exception
File "/usr/local/lib/python3.10/dist-packages/pandare/panda.py", line 972, in wrapper
f()
File "/usr/local/lib/python3.10/dist-packages/pandare/utils.py", line 106, in wrapper
return func(*args, **kwargs)
File "/home/jyq/PyPandaCode/run_cmd.py", line 22, in run_cmd
print(panda.run_serial_cmd("ls"))
File "/usr/local/lib/python3.10/dist-packages/pandare/utils.py", line 106, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pandare/panda.py", line 2416, in run_serial_cmd
result = self.serial_console.expect(timeout=timeout)
File "/usr/local/lib/python3.10/dist-packages/pandare/panda_expect.py", line 435, in expect
raise TimeoutExpired(f"{self.name} Read message \n{full_buffer}\n")
pandare.panda_expect.TimeoutExpired: serial Read message
['ls', bytearray(b'Password: \r')]
Does Panda have any special requirements for newly created snapshots?
Is the timing of when I save the snapshot incorrect? What is the correct timing to save the snapshot?
Should I save the snapshot before entering the username 'root,' or after entering the username but before entering the password, or after successfully logging in?
Or is there a problem with the way I took the snapshot?
Please help me, I would greatly appreciate it.
from panda.
If you want to use a new snapshot with run_serial_command
the snapshot will need to be taken after you log in and there's a command prompt for it to type commands into.
from panda.
I don't think there's much documentation around this (sorry!) it's not a feature that gets much use. If you want to help fix that PRs are always welcome :)
from panda.
Related Issues (20)
- Dockerhub images not updating HOT 4
- COSI examples don't work HOT 1
- AArch64 Docker container
- OSI Linux broken since `thread_group` removed HOT 2
- [Security] some vulnerability is caused by qemu code HOT 1
- RR rr_assertion `current_item' failed HOT 2
- PANDA container seems broken
- Error while running ../build.sh HOT 1
- offset/i_t.h not found while running ../build.sh HOT 2
- Callstack instr affected by panda_precise_pc & TB chaining
- Error while running python/examples/bbc_www.py because snapshot 'root' is not presented. HOT 1
- PyPlugins not always unloaded HOT 1
- How to load a .qcow2 format img? Any example? HOT 1
- No httpd and other apps are installed in the ubuntu_1604_x86.qcow HOT 1
- Docker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /lib/libosi.so) HOT 3
- Missing protobuf dependency in container HOT 2
- CI fails to publish PyPANDA HOT 2
- Missing colorama dependency in container
- PANDA[taint2]WARNING: Variable shift amount for opcode 25; control bits may be incorrect. HOT 1
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.