ctaggart / rusty-vscode

Rust + VSCode + RustyCode on a Docker Image
MIT License
4 stars 3 forks source link

document running from Azure #2

Closed ctaggart closed 8 years ago

ctaggart commented 8 years ago

image

ctaggart commented 8 years ago

image

Download and install Git for Windows https://git-scm.com/download/win

follow instructions for generating an ssh key https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ Git Bash "C:\Program Files\Git\git-bash.exe"

use a good passphrase to secure the private key file image

image

feel free to add the public key here https://github.com/settings/ssh

https://azure.microsoft.com/en-us/pricing/details/virtual-machines/ A2 is $0.094/hr

image

ctaggart commented 8 years ago

image

docker pull ctaggart/rusty-vscode docker run --rm -it -p 6100:6100 ctaggart/rusty-vscode

C:\Program Files (x86)\Xpra $env:path="C:\Program Files (x86)\Xpra;$env:path"

PS C:\Users\c> $env:path="C:\Program Files (x86)\Xpra;$env:path"
PS C:\Users\c> xpra_cmd --version
xpra v0.17.1
PS C:\Users\c> xpra_cmd --help
Usage:
        Xpra_cmd.exe attach [DISPLAY]
        Xpra_cmd.exe detach [DISPLAY]
        Xpra_cmd.exe screenshot filename [DISPLAY]
        Xpra_cmd.exe info [DISPLAY]
        Xpra_cmd.exe control DISPLAY command [arg1] [arg2]..
        Xpra_cmd.exe print DISPLAY filename     Xpra_cmd.exe version [DISPLAY]
        Xpra_cmd.exe showconfig
        Xpra_cmd.exe shadow [DISPLAY]
(This xpra installation does not support starting local servers.)

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit

  Server Options:
    These options are only relevant on the server when using the 'shadow'
    mode.

    --start=CMD         program to spawn in new server (may be repeated).
                        Default: [].
    --start-child=CMD   program to spawn in new server, taken into account by
                        the exit-with-children option (may be repeated to run
                        multiple commands). Default: [].
    --start-after-connect=START_AFTER_CONNECT
                        program to spawn in new server after the first client
                        has connected (may be repeated). Default: [].
    --start-child-after-connect=START_CHILD_AFTER_CONNECT
                        program to spawn in new server after the first client
                        has connected, taken into account by the exit-with-
                        children option (may be repeated to run multiple
                        commands). Default: [].
    --start-on-connect=START_ON_CONNECT
                        program to spawn in new server every time a client
                        connects (may be repeated). Default: [].
    --start-child-on-connect=START_CHILD_ON_CONNECT
                        program to spawn in new server every time a client
                        connects, taken into account by the exit-with-children
                        option (may be repeated). Default: [].
    --exec-wrapper=CMD  Wrapper for executing commands. Default: .
    --exit-with-children
                        Terminate the server when the last --start-child
                        command(s) exit
    --start-new-commands=yes|no
                        Allows clients to execute new commands on the server.
                        Default: no.
    --dbus-launch=CMD   Start the session within a dbus-launch context, leave
                        empty to turn off. Default: dbus-launch --close-
                        stderr.
    --env=ENV           Define environment variables used with 'start-child'
                        and 'start', can be specified multiple times. Default:
                        .
    --file-transfer=yes|no
                        Support file transfers. Default: yes.
    --printing=yes|no   Support printing. Default: yes.
    --exit-with-client=yes|no
                        Terminate the server when the last client disconnects.
                        Default: no
    --idle-timeout=IDLE_TIMEOUT
                        Disconnects the client when idle (0 to disable).
                        Default: 0 seconds
    --server-idle-timeout=SERVER_IDLE_TIMEOUT
                        Exits the server when idle (0 to disable). Default: 0
                        seconds
    --resize-display=yes|no
                        Whether the server display should be resized to match
                        the client resolution. Default: no.
    --bind=SOCKET       Listen for connections over unix domain sockets. You
                        may specify this option multiple times to listen on
                        different locations.
    --bind-tcp=[HOST]:PORT
                        Listen for connections over TCP (use --tcp-auth to
                        secure it). You may specify this option multiple times
                        with different host and port combinations
    --mdns=yes|no       Publish the session information via mDNS. Default:
                        yes.

  Server Controlled Features:
    These options can be used to turn certain features on or off, they can
    be specified on the client or on the server, but the client cannot
    enable them if they are disabled on the server.

    --clipboard=yes|no|clipboard-type
                        Enable clipboard support. Default: yes.
    --notifications=yes|no
                        Forwarding of system notifications. Default: yes.
    --system-tray=yes|no
                        Forward of system tray icons. Default: yes.
    --cursors=yes|no    Forward custom application mouse cursors. Default:
                        yes.
    --bell=yes|no       Forward the system bell. Default: yes.
    --webcam=WEBCAM     Webcam forwarding, can be used to specify a device.
                        Default: auto.
    --global-menus=yes|no
                        Forward application global menus. Default: yes.
    --mmap=yes|no       Use memory mapped transfers for local connections.
                        Default: no.
    --readonly=yes|no   Disable keyboard input and mouse events from the
                        clients. Default: no.
    --sharing=yes|no    Allow more than one client to connect to the same
                        session. Default: no.
    --remote-logging=yes|no|both
                        Forward all the client's log output to the server.
                        Default: yes.
    --speaker=on|off|disabled
                        Forward sound output to the client(s). Default: on.
    --speaker-codec=SPEAKER_CODEC
                        Specify the codec(s) to use for forwarding the speaker
                        sound output.     This parameter can be specified
                        multiple times and the order in which the codecs
                        are specified defines the preferred codec order.
                        Use the special value 'help' to get a list of options.
                        When unspecified, all the available codecs are allowed
                        and the first one is used.
    --microphone=on|off|disabled
                        Forward sound input to the server. Default: off.
    --microphone-codec=MICROPHONE_CODEC
                        Specify the codec(s) to use for forwarding the
                        microphone sound output.     This parameter can be
                        specified multiple times and the order in which the
                        codecs     are specified defines the preferred codec
                        order.     Use the special value 'help' to get a list
                        of options.     When unspecified, all the available
                        codecs are allowed and the first one is used.
    --sound-source=SOUND_SOURCE
                        Specifies which sound system to use to capture the
                        sound stream (use 'help' for options)
    --av-sync=AV_SYNC   Try to synchronize sound and video. Default: yes.

  Encoding and Compression Options:
    These options are used by the client to specify the desired picture
    and network data compression.They may also be specified on the server
    as default values for those clients that do not set them.

    --encodings=ENCODINGS
                        Specify which encodings are allowed. Default: all.
    --encoding=ENCODING
                        Which image compression algorithm to use, specify
                        'help' to get a list of options. Default: .
    --video-encoders=VIDEO_ENCODERS
                        Specify which video encoders to enable, to get a list
                        of all the options specify 'help'
    --csc-modules=CSC_MODULES
                        Specify which colourspace conversion modules to
                        enable, to get a list of all the options specify
                        'help'. Default: ['all'].
    --video-decoders=VIDEO_DECODERS
                        Specify which video decoders to enable, to get a list
                        of all the options specify 'help'
    --video-scaling=SCALING
                        How much automatic video downscaling should be used,
                        from 1 (rarely) to 100 (aggressively), 0 to disable.
                        Default: 1.
    --min-quality=MIN-LEVEL
                        Sets the minimum encoding quality allowed in automatic
                        quality setting, from 1 to 100, 0 to leave unset.
                        Default: 30.
    --quality=LEVEL     Use a fixed image compression quality - only relevant
                        to lossy encodings, from 1 to 100, 0 to use automatic
                        setting. Default: 0.
    --min-speed=SPEED   Sets the minimum encoding speed allowed in automatic
                        speed setting, from 1 to 100, 0 to leave unset.
                        Default: 30.
    --speed=SPEED       Use image compression with the given encoding speed,
                        from 1 to 100, 0 to use automatic setting. Default: 0.
    --auto-refresh-delay=DELAY
                        Idle delay in seconds before doing an automatic
                        lossless refresh. 0.0 to disable. Default: 0.15.
    --compressors=COMPRESSORS
                        The packet compressors to enable. Default: lz4, lzo,
                        zlib.
    --packet-encoders=PACKET_ENCODERS
                        The packet encoders to enable. Default: rencode,
                        bencode, yaml.
    -z LEVEL, --compress=LEVEL
                        How hard to work on compressing data. You generally do
                        not need to use this option, the default value should
                        be adequate, picture data is compressed separately
                        (see --encoding). 0 to disable compression, 9 for
                        maximal (slowest) compression. Default: 1.

  Client Features Options:
    These options control client features that affect the appearance or
    the keyboard.

    --opengl=yes|no|auto
                        Use OpenGL accelerated rendering. Default: auto.
    --windows=yes|no    Forward windows. Default: yes.
    --session-name=SESSION_NAME
                        The name of this session, which may be used in
                        notifications, menus, etc. Default: 'Xpra'.
    --max-size=MAX_SIZE
                        The maximum size for all windows, ie: 800x600.
                        Default: ''.
    --desktop-scaling=SCALING
                        How much to scale the client desktop by. This value
                        can be specified in the form of absolute pixels:
                        "WIDTHxHEIGHT" as a fraction: "3/2" or just as a
                        decimal number: "1.5". You can also specify each
                        dimension individually: "2x1.5". Default: 'auto'.
    --shadow-fullscreen=SHADOW_FULLSCREEN
                        Make the window fullscreen if it is from a shadow
                        server, scaling it to fit the screen. Default:
                        'False'.
    --border=BORDER     The border to draw inside xpra windows to distinguish
                        them from local windows.Format: color[,size]. Default:
                        'auto,5:off'
    --title=TITLE       Text which is shown as window title, may use remote
                        metadata variables. Default: '@title@ on @client-
                        machine@'.
    --window-icon=WINDOW_ICON
                        Path to the default image which will be used for all
                        windows (the application may override this)
    --window-close=WINDOW_CLOSE
                        The action to take when a window is closed by the
                        client. Valid options are: 'forward', 'ignore',
                        'disconnect'. Default: 'auto'.
    --tray=yes|no       Enable Xpra's own system tray applet, this will also
                        disable notifications. Default: yes
    --tray-icon=TRAY_ICON
                        Path to the image which will be used as icon for the
                        system-tray or dock
    --key-shortcut=KEY_SHORTCUT
                        Define key shortcuts that will trigger specific
                        actions.If no shortcuts are defined, it defaults to:
                        Meta+Shift+F1:show_menu
                        Meta+Shift+F2:show_start_new_command
                        Meta+Shift+F3:show_bug_report  Meta+Shift+F4:quit
                        Meta+Shift+F5:increase_quality
                        Meta+Shift+F6:decrease_quality
                        Meta+Shift+F7:increase_speed
                        Meta+Shift+F8:decrease_speed  Meta+Shift+F10:magic_key
                        Meta+Shift+F11:show_session_info
                        Meta+Shift+F12:toggle_debug  Meta+Shift+plus:scaleup
                        Meta+Shift+minus:scaledown
                        Meta+Shift+underscore:scaledown
                        Meta+Shift+KP_Add:scaleup
                        Meta+Shift+KP_Subtract:scaledown
                        Meta+Shift+KP_Multiply:scalereset
                        Meta+Shift+bar:scalereset
                        Meta+Shift+question:scalingoff
    --keyboard-sync=yes|no
                        Synchronize keyboard state. Default: yes.

  Advanced Options:
    These options apply to both client and server. Please refer to the man
    page for details.

    --password-file=PASSWORD_FILE
                        The file containing the password required to connect
                        (useful to secure TCP mode). Default: ''.
    --input-method=INPUT_METHOD
                        Which X11 input method to configure for client
                        applications started with start or start-child
                        (default: 'none', options: none, keep, xim, IBus,
                        SCIM, uim)
    --dpi=DPI           The 'dots per inch' value that client applications
                        should try to honour, from 10 to 1000 or 0 for
                        automatic setting. Default: auto.
    --sync-xvfb=SYNC_XVFB
                        How often to synchronize the virtual framebuffer used
                        for X11 seamless servers (0 to disable). Default: 0.
    --socket-dirs=SOCKET_DIRS
                        Directories to look for the socket files in. Default:
                        'C:\Users\c\AppData\Roaming\Xpra'.
    --socket-dir=SOCKET_DIR
                        Directory to place/look for the socket files in.
                        Default: '$XPRA_SOCKET_DIR or the first valid
                        directory in socket-dirs'.
    -d FILTER1,FILTER2,..., --debug=FILTER1,FILTER2,...
                        List of categories to enable debugging for (you can
                        also use "all" or "help", default: '')
    --ssh=CMD           How to run ssh. Default: 'plink -ssh -agent'.
    --exit-ssh=yes|no|auto
                        Terminate SSH when disconnecting. Default: True.
    --username=USERNAME
                        The username supplied by the client for
                        authentication. Default: 'c'.
    --auth=AUTH         The authentication module to use (default: '')
    --tcp-auth=TCP_AUTH
                        The authentication module to use for TCP sockets
                        (default: '')
    --pings=yes|no      Send ping packets every second to gather latency
                        statistics. Default: no.
    --clipboard-filter-file=CLIPBOARD_FILTER_FILE
                        Name of a file containing regular expressions of
                        clipboard contents that must be filtered out
    --local-clipboard=SELECTION
                        Name of the local clipboard selection to be
                        synchronized when using the translated clipboard
                        (default: CLIPBOARD)
    --remote-clipboard=SELECTION
                        Name of the remote clipboard selection to be
                        synchronized when using the translated clipboard
                        (default: CLIPBOARD)
    --remote-xpra=CMD   How to run xpra on the remote host (default: ~/.xpra
                        /run-xpra or $XDG_RUNTIME_DIR/xpra/run-xpra or xpra)
    --encryption=ALGO   Specifies the encryption cipher to use, specify 'help'
                        to get a list of options. (default: None)
    --encryption-keyfile=FILE
                        Specifies the file containing the encryption key.
                        (default: '')
    --tcp-encryption=ALGO
                        Specifies the encryption cipher to use for TCP
                        sockets, specify 'help' to get a list of options.
                        (default: None)
    --tcp-encryption-keyfile=FILE
                        Specifies the file containing the encryption key to
                        use for TCP sockets. (default: '')
ctaggart commented 8 years ago
--ssh=CMD           How to run ssh. Default: 'plink -ssh -agent'.

image

ctaggart commented 8 years ago

image

run puttygen and import id_rsa private key. I saved it as id_rsa.ppk image

ctaggart commented 8 years ago

I can establish a connection from xpra client to server, but I this is what I get in the log when I try to connect:

2016-05-08 19:42:01,308 New connection received: SocketConnection(('127.0.0.1', 6100) - ('127.0.0.1', 44442))
2016-05-08 19:42:01,608 Handshake complete; enabling connection
2016-05-08 19:42:01,610 Python/Gtk2 Microsoft Windows 10 client version 0.17.1 connected from 'S7' as 'cameron' ('c')
2016-05-08 19:42:01,610 using h264 as primary encoding, also available: vp8, rgb24, rgb32
2016-05-08 19:42:01,610 client root window size is 1600x900 with 1 displays:
2016-05-08 19:42:01,611   '1\WinSta-Default' (423x238 mm) workarea: 1600x860 at 0x40
2016-05-08 19:42:01,611 failed to parse screen size information: too many values to unpack
2016-05-08 19:42:01,611 server error processing new connection from Protocol(SocketConnection(('127.0.0.1', 6100) - ('127.0.0.1', 44442))): too many values to unpack
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/server/server_core.py", line 462, in call_hello_oked
    self.hello_oked(proto, packet, c, auth_caps)
  File "/usr/lib/python2.7/dist-packages/xpra/server/server_base.py", line 588, in hello_oked
    root_w, root_h = self.set_best_screen_size()
  File "/usr/lib/python2.7/dist-packages/xpra/x11/x11_server_base.py", line 278, in set_best_screen_size
    return self.set_screen_size(max_w, max_h)
  File "/usr/lib/python2.7/dist-packages/xpra/x11/x11_server_base.py", line 323, in set_screen_size
    xinerama_changed = self.save_fakexinerama_config()
  File "/usr/lib/python2.7/dist-packages/xpra/x11/x11_server_base.py", line 429, in save_fakexinerama_config
    plug_name, x, y, width, height, wmm, hmm = m[:8]
ValueError: too many values to unpack
2016-05-08 19:42:01,611 Disconnecting client Protocol(SocketConnection(('127.0.0.1', 6100) - ('127.0.0.1', 44442))): server error (error accepting new connection)
2016-05-08 19:42:01,612 xpra client disconnected.

PS C:\Users\c> xpra_cmd --version xpra v0.17.1

cameron@vscode-demo:~$ xpra --version xpra v0.14.25

I wonder why the Debian installed server version is so much older. There may be something incompatible.

ctaggart commented 8 years ago

The version in the docker image is: vscode@vscode-demo:~$ xpra --version xpra v0.14.10

ctaggart commented 8 years ago

start VSCode on Azure

"C:\Program Files\Git\git-bash.exe" ssh -L 6100:0.0.0.0:6100 cameron@vscode-demo.cloudapp.net docker run --rm -it --net=host ctaggart/rusty-vscode . start-xpra.sh git clone https://github.com/diesel-rs/diesel.git code diesel/diesel

attach xpra to display the windows locally

$env:path="C:\Program Files (x86)\Xpra;$env:path" xpra_cmd attach tcp:127.0.0.1:6100

ctaggart commented 8 years ago

http://blog.ctaggart.com/2016/05/rustycode-running-on-docker-in-azure.html