Git Product home page Git Product logo

cv4pve-pepper's Introduction

cv4pve-pepper

License

     ______                _                      __
    / ____/___  __________(_)___ _   _____  _____/ /_
   / /   / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
  / /___/ /_/ / /  (__  ) / / / / |/ /  __(__  ) /_
  \____/\____/_/  /____/_/_/ /_/|___/\___/____/\__/


  Launching SPICE remote-viewer for Proxmox VE   (Made in Italy)

  cv4pve-pepper is a part of suite cv4pve.
  For more information visit https://www.corsinvest.it/cv4pve

Usage:
  cv4pve-pepper [options]

Options:
  --api-token <api-token>                Api token format 'USER@REALM!TOKENID=UUID'. Require Proxmox VE 6.2 or later
  --username <username>                  User name <username>@<realm>
  --password <password>                  The password. Specify 'file:path_file' to store password in file.
  --validate-certificate                 Validate SSL Certificate Proxmox VE node.
  --host <host> (REQUIRED)               The host name host[:port],host1[:port],host2[:port]
  --vmid <vmid>                          The id or name VM/CT
  --proxy <proxy>                        SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs
                                         'spiceproxy', so it is up to the client to choose one. By default, we return the node to connect. If specify
                                         http(s)://[host]:[port] then replace proxy option in file .vv. E.g. for reverse proxy.
  --viewer <viewer> (REQUIRED)           Executable SPICE client remote viewer (remote-viewer executable)
  --viewer-options <viewer-options>      Send options directly SPICE Viewer (quote value).
  --start-or-resume                      Run stopped or paused VM
  --wait-for-startup <wait-for-startup>  Wait sec. for startup VM [default: 5]
  --version                              Show version information
  --debug                                Show debug information
  -?, -h, --help                         Show help and usage information

Copyright and License

Copyright: Corsinvest Srl For licensing details please visit LICENSE.md

Commercial Support

This software is part of a suite of tools called cv4pve-tools. If you want commercial support, visit the site

Introduction

Launching SPICE remote-viewer having access VM running on Proxmox VE.

this software aims to simplify run SPICE client from Proxmox VE using command line. The reasons are:

  • Proxmox VE uses tickets that expire
  • do not use graphical interface (GUI)
  • no download .vv file to run remove viewer
  • use a simple client

Main features

  • Completely written in C#
  • Use native api REST Proxmox VE (library C#)
  • Independent os (Windows, Linux, Macosx)
  • Installation unzip file extract binary
  • Not require installation in Proxmox VE
  • Execute out side Proxmox VE
  • Not require Web login
  • Support multiple host for HA in --host parameter es. host[:port],host1[:port],host2[:port]
  • Start or Resume VM on connection
  • Check-Update and Upgrade application
  • Use Api token --api-token parameter
  • Send options directly to viewer
  • Execution with file parameter e.g. @FileParameter.parm
  • Validate certificate SSL, default not validate

Api token

From version 6.2 of Proxmox VE is possible to use Api token. This feature permit execute Api without using user and password. If using Privilege Separation when create api token remember specify in permission.

Configuration and use

E.g. install on linux 64

Download last package e.g. Debian cv4pve-pepper-linux-x64.zip, on your os and install:

root@debian:~# unzip cv4pve-pepper-linux-x64.zip

This tool need basically no configuration.

Run

root@debian:~# cv4pve-pepper --host=192.168.0.100 --username=root@pam --password=fagiano --vmid 100 --viewer path-spice-viewer

SPICE client

Topical path of remote viewer

  • Linux /usr/bin/remote-viewer
  • Windows C:\Program Files\VirtViewer v?.?-???\bin\remote-viewer.exe

Options of remote viewer

Use --viewer-options to send options to viewer. E.g. --viewer-options "-f" for full screen.

Error

  • no spice port: This error appears when you have not configured the display hardware on SPICE.

Execution with file parameter

Is possible execute with file parameter

root@debian:~# cv4pve-pepper @FileParameter.parm

File FileParameter.parm

--host=192.168.0.100
--username=root@pam
--password=fagiano
--vmid 100
--viewer path-spice-viewer

cv4pve-pepper's People

Contributors

chouffy avatar eeems avatar franklupo avatar victorioustr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cv4pve-pepper's Issues

Info on connection log

Hi So thanks for the super nice application. It just work perfectly, set the proxy ip option and hop. Just small question: after connection, the command prompt pump lot of message about :
(remote-viewer.exe:7140): CRITICAL **: 14:49:10.206: gst_app_src_push_internal: assertion 'GST_IS_APP_SRC (appsrc)' failed

I haven't find what it mean. Any idea ? run over prox 7.1 Was it about a system security or certificate ? just to know

thanks in advance

Unable to connect to libvirt with URI: [none]

Hi,

I have trouble making this work, unfortunately :(
This is my command line call: cv4pve-pepper.exe --host=HOST.lan --api-token 'cv4pve@pve!spice=uuidhere' --vmid 400 --viewer D:\Apps\Applications\VirtViewer\bin\virt-viewer.exe (System: Windows 11 23H2 x64"
The call returns nothing (but no error either)

And I get this message box that says "Unable to connect to libvirt with URI: [none]"
image

I've checked the permission of mycv4pve user, and I can open a SPICE console from the web GUI.
I also checked that I assigned an API Token permission specifically to the 400 VM

Any help welcome!

Problem Connetion

I am using the tool with Ubuntu 20.04.

/opt/cv4pve-pepper/cv4pve-pepper --host=192.168.2.5 --username=root@pam --password=root123 --vmid=101 --viewer /usr/bin/remote-viewer
I get always the error "Problem connection!". What's wrong?
I started it with --debug too. But where is the log?

Regards Steffen

Multipass Ubuntu / Macosx Forwarding

Hi Frank,

Thanks for your app, it greatly simplifies my windows spice connections and for that, I thank you. I was wondering if I could forward this cv4pve-pepper app to Xquartz through ssh -XY etc I have tried it with exporting DISPLAY as a shell and I have tried running the app as a forward ssh session. Remote Viewer runs ok in XQuartz?

any idea if your cv4pepper will forward through ssh -XY session, it appears to run but I don't get an XQuartz window opening, I have installed firefox and it runs ok.

RaspberryPi

Hi,

this version cv4pve-pepper-linux-arm works on RaspberryPi Model B?

thanks

Failed to connect

cv4pve-pepper --username root@pam --password test --host saturn.home --vmid 120 --viewer /usr/bin/virt-viewer

image

I have confirmed the vmid

Pass arguments to remote-viewer.exe from cv4pve-pepper?

Hi all,

Would it be possible to pass some command line arguments like -f and -z to remote-viewer while calling cv4pve-pepper? I would like to script for starting zoomed and in full-screen for some of my guests, but the remote-viewer line doesn't like having arguments at the end and fails to launch.

lxc container

Does not work with lxc container.
cv4pve-pepper.exe" --host 192.168.10.122:8006 --username root --password ******* --vmid 733 --viewer "C:\Program Files\VirtViewer v11.0-256\bin\remote-viewer.exe"
Returns an error "Configuration file 'nodes/pve/qemu-server/733.conf' does not exist"
lxc container are located in 'nodes/pve/lxc/733.conf'
What am I doing wrong?

Who's using Pepper

If you or your company is using cv4pve-pepper we would like to showcase it on our website.

Host Number:
VM/CT Number:
User Number:
Company (optional)
Only post your project/application in here, please do not comment or ask questions.

so problem

hi
my english is bad, sorry
after downloading, unziping and starting
i get error
Cannot find guest domain /tmp/tmpJYBd7G.vv
./cv4pve-pepper --host=10.192.10.132:8006 --username=root@pam --password=password --vmid=100 --viewer=/usr/bin/virt-viewer
How fix ?
Thx advice

how to connect with --api-token ?

Hi, you have this example:

cv4pve-pepper --host=192.168.0.100 --username=root@pam --password=fagiano --vmid 100 --viewer path-spice-viewer

but i want to connect with --api-token

can you give example, how to use --api-token instead of --password ?

Faulty or nonexistent vv-file?

Hello,

Starting the cv4pve-pepper.exe on Windows 10 only returns an error message from remote viewer, stating the connection to the grafic-server using the vv-file cannot be established.

Using the Windows Explorer, I searched for the vv-file. There is no vv-file of the stated name, only an empty tmp-file, but maybe remote viewer has already deleated it.

I am able to connect to spice using the webinterface and the user I created for this matter.

Arguments used:
--host=192.168.178.10 --username=username@pam --password=password --vmid 101 --viewer "C:\Program Files\VirtViewer v11.0-256\bin\remote-viewer.exe"

Error message (German):
image

Support multiple host for HA in --proxy

Hello Frank,
First of all thank you for this wonderful tool,just tested windows x64 version with parameter --proxy with success.
I just made 3 node Proxmox 7 HA Ceph cluster for our VDI needs,is it possible add HA multiple host support for parameter --proxy?

or is it needed?what happens when SPICE proxy server is dead?will all remote-viewer clients will drop connection?

Thanks in advance,
Hafiz.

errors via both password or api token

Hi, when executing the following command on unubtu desktop 16.04:

./cv4pve-pepper --host=10.0.2.20 --username root@pam --password PWD --vmid 104 --viewer /usr/bin/remote-viewer

all I get is

================ EXCEPTION ================ Microsoft.CSharp.RuntimeBinder.RuntimeBinderException 'System.Dynamic.ExpandoObject' does not contain a definition for 'data' at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.ToEnumerable(Result result) at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client) at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVM(PveClient client, String idOrName) at Corsinvest.ProxmoxVE.Api.Extension.Helpers.SpiceHelper.CreateFileSpaceClient(PveClient client, String vmIdOrName, String fileName) at Corsinvest.ProxmoxVE.Pepper.Program.<>c__DisplayClass0_0.<Main>b__0() at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)

already tried with and without port after the host

Proxmox 6.2.4
cv4pve 1.3.1

any hint?
Thanks
Stefano

No spice port

When I execute the script in U20.04, it executes but nothing happens.
./cv4pve-pepper --host=192.168.1.111 --username=root --password=secret --vmid 100 --viewer /usr/bin/virt-viewer
I'm using the following:
--host=IP of the Proxmox server
--username=same username as when logging in to Proxmox from the web interface
--password=same password as when logging in to Proxmox from the web interface
--vmid=virtual machine number in Proxmox
Adding the --debug switch reveals a "no spice port" error. Where do I specify the Spice port?

Could I specify the port for the proxy?

I run my Proxmox VE using frp reverse proxy for remote access. The local web gui page https://192.168.123.182:8006/ is redirected to https://43.249.xxx.xxx:55012 and the local's 3128 port is also redirected to remote 55011 port.

If I want to use SPICE remotely, I have to download the .vv file and quickly edit the proxy's line from proxy=http://43.249.xxx.xxx:3128 to proxy=http://43.249.xxx.xxx:55011 in able to connect. Since the *.vv file expires in 30 seconds, it's not easy to do so.

So I searched around and found this project, but it seems it can's specify the port for the proxy either. If I run this command, it can fetch the .vv file, but it's still using the 3128 proxy port.

.\cv4pve-pepper.exe --host 43.249.xxx.xxx:55012 --username root@pam --password ****** --vmid 110 --viewer "C:\Program Files\VirtViewer v9.0-256\bin\remote-viewer.exe" --proxy 43.249.xxx.xxx --debug

If I run this command by adding the port, it can't fetch the .vv file

.\cv4pve-pepper.exe --host 43.249.xxx.xxx:55012 --username root@pam --password ****** --vmid 110 --viewer "C:\Program Files\VirtViewer v9.0-256\bin\remote-viewer.exe" --proxy 43.249.xxx.xxx:55011 --debug

It will result in:

=============================
Method: POST, Url: https://43.249.xxx.xxx:55012/api2/spiceconfig/nodes/pve5/qemu/110/spiceproxy
Parameters:
proxy : http://43.249.xxx.xxx:55011
StatusCode:          BadRequest
ReasonPhrase:        Parameter verification failed.
IsSuccessStatusCode: False

=============================

Could I specify the port for the proxy?

X86 build

Please add binnary for linux-i386

Keep getting "VM/CT ### Not Found"

Let me start by saying I had this working. I was running a VM (ID 106) with an install of Linux Lite and the Display set to SPICE.

I was able to connect to the Spice session from a Raspberry Pi using the command:
cv4pve-pepper --host=192.168.7.5 --username=vm-viewer@pve --password=<redacted> --vmid 106 --viewer-options "-k -f" --viewer /usr/bin/remote-viewer

Today I was having no love for Linux Lite and replaced it with Xubuntu (deleted the VM and created a new one, which got assigned the same ID 106). I have it set with the SPICE display as well and I can access it from my desktop by opening the vv file in Remote Viewer. But the above command on the Raspberry Pi just keeps saying that it cannot find the VM:
Unhandled exception: System.ArgumentException: VM/CT '106' not found! at Corsinvest.ProxmoxVE.Api.Extension.ClientExtension.GetVm(PveClient client, String vmIdOrName) at Corsinvest.ProxmoxVE.Pepper.Program.<>c__DisplayClass0_0.<<Main>b__0>d.MoveNext() --- End of stack trace from previous location ---
I also get the same error if I try to run the above command from my Desktop. So it seems I can launch it with the temporary vv file. but can no longer launch it using cv4pve-pepper.

GSpice-Critical

Once in a while i can getting this error when using your tools

image

Thanks

Raspberry PI running Buster Exception

On a Raspberry PI 3 running the latest version of Raspberry OS (Buster), and using the ARM version of cv4pve-pepper when I run the following command:

./cv4pve-pepper --host=192.168.1.2 --username=root --password=testPassw0rd --vmid 104 --viewer /usr/bin/virt-viewer

I get the following exception:

================ EXCEPTION ================ System.ComponentModel.Win32Exception No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Corsinvest.ProxmoxVE.Pepper.Program.<>c__DisplayClass0_0.<Main>b__0() at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)

Error: Unknown Host

Hello,

I'm trying to launch cv4pve-pepper 1.3.7 with ./cv4pve-pepper --host=80.XXX.XXX.XXX:8006 --username=XXXX@XXXX --password=XXXX --vmid=124 --viewer=/usr/bin/virt-viewer and also tried it without specifying the port.
All I get is the following Error:

Error: unknown host 80.XXX.XXX.XXX
Problem connection!

with the --debug flag I get the following:

================ EXCEPTION ================ 
System.ApplicationException
Problem connection!
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.CommandOptionExtension.ClientTryLogin(CommandLineApplication command)
   at Corsinvest.ProxmoxVE.Pepper.Program.<>c__DisplayClass0_0.<Main>b__0()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)

I can open the Web GUI just fine with that URL. What am I missin?

Spiceproxy not implemented

I recently updated my PVE host to 8.2, and cv4pve-pepper was also updated through the Aur on Arch so I'm not sure which was the actual cause but but running my usual command to launch a session results in the below error. Any help or direction is appreciated.

cv4pve-pepper --host=10.10.20.20 --api-token 'root@pam!pveapi=25349687-dcbe-4d8d-b4d5-a6c3e2a4a3f2' --vmid 102 --viewer /usr/bin/remote-viewer

Error: Method 'POST /nodes/pve/qemu/qemu/102/spiceproxy' not implemented'

spiceproxy and pveproxy are both running and starting a spice session via the PVE web admin works without issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.