amitbet / vncproxy

An RFB proxy, written in go that can save and replay FBS files
Other
212 stars 45 forks source link

Can you give me a more detail about how to use this vncproxy in my project #3

Closed andyzheung closed 4 years ago

andyzheung commented 6 years ago

If I have a VM create by KVM,and support VNC connect。 my VNC Server ip is 8.11.192.3, vncport of the VM is 5908.

how to use this vncproxy, that I can view this VM by tigerVNC? image

andyzheung commented 6 years ago

I input ./recorder -recDir=./recording.rbs -targHost=8.11.193.3 -targPort=5908 -targPass=xxx12#$ ./proxy -recDir=./ -targHost=8.11.193.3 -targPort=5908 -targPass=xxx12#$ -tcpPort=5911 -vncPass=xxx12#$

then I use TigerVNC login: image

amitbet commented 6 years ago

Hi Andy, encoding types -260 to -272 belong to the QEMU extension to VNC, which KVM uses, vncProxy doesn't support these types yet, since I never tested it agains KVM machines. Support can be added by pass-through, but I don't have such a machine to test against, if you are interested, I can direct you to the relevant locations in the code.

andyzheung commented 6 years ago

Yes, I am very interesting. please direct me, and do we have any other communication ways to talk about this?

amitbet commented 6 years ago

qemu has some additions to the RFB protocol: https://github.com/qemu/qemu/blob/master/ui/vnc.h https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#led-state-pseudo-encoding https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#qemu-extended-key-event-pseudo-encoding https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#qemu-audio-pseudo-encoding https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#qemu-pointer-motion-change-pseudo-encoding

define VNC_ENCODING_POINTER_TYPE_CHANGE 0XFFFFFEFF / -257 /

define VNC_ENCODING_EXT_KEY_EVENT 0XFFFFFEFE / -258 /

define VNC_ENCODING_AUDIO 0XFFFFFEFD / -259 /

define VNC_ENCODING_TIGHT_PNG 0xFFFFFEFC / -260 /

define VNC_ENCODING_LED_STATE 0XFFFFFEFB / -261 /

define VNC_ENCODING_WMVi 0x574D5669

some of these might pop up during the VNC communications I have some handling in place for -257, -258 you have been experiencing problems with -261 (LED_STATE), all you need is to pass it through. I created a pseudo encoding for it, and added it to the project. look for EncLedStatePseudo in the code. since this psaeudo-enc does have some data attached to it (a single byte indicating the led state), we need to read it - so i created a struct, with a read function that reads a single uint8. I also added this encoding to the list of supported encodings in the proxy commandline utility in /proxy/cmd/main.go Since I don't have access to such a machine, you should try it and either fix any bugs or keep reporting back about what you find.

Regards, Amit.

amitbet commented 6 years ago

BTW: do you know how to compile a go project?

andyzheung commented 6 years ago

I am sorry that I have some other things to do this days, so reply you so late. I know how to compile a go project. what I should do is download the code and compile it and test?

amitbet commented 6 years ago

Yeah, And tell me if you get into trouble 😎

andyzheung commented 6 years ago

I download the new code, and try it but: image

amitbet commented 6 years ago

there is very little info in your message... did you connect, did it start sending messages? is there any message that might indicate the reason for the failure?

amitbet commented 6 years ago

if you only get error messages, than you should go to logger.go and change the logging level to debug then compile and run.

greatpeter commented 6 years ago

BTW: do you know how to compile a go project?

Hi amitbet. Thx for your effort for this project. I would like to try this and put it on one linux server and try to compile. However, I could not success. The linux server already installed go. Could you please advise how to compile and then use it? Thx.

amitbet commented 5 years ago

you should go to the vncproxy/proxy/cmd directory go get go build that should create a binary file that you can run.

amitbet commented 5 years ago

Did you succeed? if not you should to set a gopath and clone the sources somewhere under the $GOPATH/src directory. (it's what golang requires)