create a screenshot of the virtual machine

hronny

New Member
Apr 19, 2014
25
0
1
Germany
Sometimes I would like to see a screenshot of the virtual machine. Of course I could do this via the console also, but always start Java here and confirm all safety messages annoying sometimes. I would also use a static image here. Is there a way to do such a thing?
 
Sometimes I would like to see a screenshot of the virtual machine. Of course I could do this via the console also, but always start Java here and confirm all safety messages annoying sometimes. I would also use a static image here. Is there a way to do such a thing?
Are you talking about the feature in Hyper-V where in the console gui it shows a static screenshot of the VM inside without actually opening a console into it?
Supermicro IPMI also has this feature in the Console GUI. I can see the usefulness when checking on many VMs without actually logging in through console. Could be placed where the Note box is in current Proxmox GUI. I think its a good candidate for feature request.
 
:D Yes you found it!

For me it is now a simple solution. An improvement or a feature request would be to be able to see this image automatically in Proxmox webinterface. What do you say?
 
Hi,

I think it's possible to take screenshot through the monitor:

#screendump /path/to/file
On debian the correct syntax is: screendump > /path/to/file
Reason: screendump dumps to stdout.

If tty is other than tty0 you need to add number for tty. Eg. if tty is tty1
screendump 1 > /path/to/file
 
Last edited:
On debian the correct syntax is: screendump > /path/to/file
Reason: screendump dumps to stdout.

If tty is other than tty0 you need to add number for tty. Eg. if tty is tty1
screendump 1 > /path/to/file
Hi,
but spirit mean through the monitor, and there it's works very good with "screendump filename" one usefull thing to use the monitor-section in the gui ;-)

Udo
 
I use the proxmox iso image with debian wheezy on board. In my system the screendump goes (connection with putty client) the normal output to a file rather than to stdout. So far I could not find a one liner for a bash script.

Code:
root@proxvm2:~# qm monitor 181
Entering Qemu Monitor for VM 181 - type 'help' for help
qm> screendump /tmp/test.ppm
qm> quit
root@proxvm2:~# ls -l /tmp/test.ppm
-rw-r----- 1 root root 1440015 Aug 31 21:36 /tmp/test.ppm
 
I use the proxmox iso image with debian wheezy on board. In my system the screendump goes (connection with putty client) the normal output to a file rather than to stdout. So far I could not find a one liner for a bash script.

Code:
root@proxvm2:~# qm monitor 181
Entering Qemu Monitor for VM 181 - type 'help' for help
qm> screendump /tmp/test.ppm
qm> quit
root@proxvm2:~# ls -l /tmp/test.ppm
-rw-r----- 1 root root 1440015 Aug 31 21:36 /tmp/test.ppm
Hi,
you are right!

Seems that qm don't work well with standard linux pipe...

Udo
 
Has anyone been able to figure out how to pipe commands into the qm monitor? I have a project and the ability to grab a screenshot is necessary! Tried using SOCAT, but I'm not familiar with how it works, or if it even does. This is a new install of PVE 5.4. Thanks in advance!
 
Has anyone been able to figure out how to pipe commands into the qm monitor?

You can automate it with expect (have to install it first, best with --no-install-recommends):

Code:
root@proxmox1 ~ > ls -l /tmp/test_12002.ppm
/bin/ls: cannot access '/tmp/test_12002.ppm': No such file or directory

root@proxmox1 ~ > ./screenshot 12002
spawn qm monitor 12002
Entering Qemu Monitor for VM 12002 - type 'help' for help
qm> screendump /tmp/test_12002.ppm
qm> quit

root@proxmox1 ~ > ls -l /tmp/test_12002.ppm
-rw-r----- 1 root root 2359312 Mar 10 23:34 /tmp/test_12002.ppm

root@proxmox1 ~ > cat screenshot
#!/usr/bin/expect

set timeout 10
set id [lindex $argv 0]

spawn qm monitor $id

expect "qm>"
send -- "screendump /tmp/test_$id.ppm\r"

expect "qm>"
send -- "quit\r"

expect eof
 
Hey there, thanks to @Moayad for pointing me in this direction I got it to work!

You can make screendump with API CLI [0], also you can write an bash script to do that.

Example:
# pvesh create /nodes/{node}/qemu/{vmid}/monitor --command "screendump /tmp/test"

# display /tmp/test
 
  • Like
Reactions: ties and Moayad

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!