[PVE-User] Spice from command line

Diaolin diaolin at diaolin.com
Thu Mar 13 08:18:56 CET 2014


Il 2014-03-12 09:39 Diaolin ha scritto:
> I will use the
> 
> command line client for accessing spice enabled vm but
> 
> ##################################################
> #!/bin/bash
> 
> 
> USERNAME=root at pam
> PASSWORD=yourpassword
> VMID=198
> NODE=proxmoxhost1
> PROXY=proxmoxhost1.test.com
> 
> DATA=`curl -k -d "username=$USERNAME&password=$PASSWORD"
> https://$PROXY:8006/api2/json/access/ticket`
> 
> TICKET=`echo $DATA|sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v
> k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed
> 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"// g'|grep -w ticket|
> awk -F "|" '{print $2}'`
> 
> CSRF=`echo $DATA|sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v
> k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed
> 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"// g'|grep -w
> CSRFPreventionToken| awk -F "|" '{print $2}'`
> 
> curl -k -b "PVEAuthCookie=$TICKET" -H "CSRFPreventionToken: $CSRF"
> https://$PROXY:8006/api2/spiceconfig/nodes/$NODE/qemu/$VMID/spiceproxy
> -d "proxy=$PROXY" > spiceproxy
> 
> remote-viewer spiceproxy
> 
> ##################################################
> 
> This command produces always a 0 size spiceproxy file
> 
> 
> I use the pve-no-subscription
> 
> do you have any hint?
> 
> Tx, Diaolin


No one uses spice via cmdline?

Ciao, Diaolin




---
S’à destacà l’ultima föia dal bósch nét
crodàda l’ei, solàgna, ‘n mèzz ai sàssi
e ‘ntant fis-ciava ‘n zìfol de oseleti
a tegnìr vìo ‘l pensér che vèn matìna
[Diaolin]



More information about the pve-user mailing list