How to set NX port on pre-existing AWS EC2 Ubuntu instance?

Forum / NoMachine for Linux / How to set NX port on pre-existing AWS EC2 Ubuntu instance?

Tagged: , , , , ,

  • This topic has 8 replies, 3 voices, and was last updated 6 years ago by kroy.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #20612
    mattroos
    Participant

    I’ve gone through this nice tutorial:

    https://www.nomachine.com/accessing-your-remote-linux-desktop-on-amazon-elastic-compute-cloud-via-NoMachine

    but it assumes one is creating an AMI from scratch. I already have a working instance. How can I allow for the NX protocol on port 4000? This info seems to address the questions

    https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html

    but I don’t know exactly what command I should issue in the terminal. E.g., what should I put for security_group_id and cidr_ip_range?

    #20627
    kroy
    Contributor

    To create a new Security Group – find “Network & Security” on the left AWS panel. Choose “Security Groups” and launch “Create Security Group”. Then:

    •     Click ‘Add Rule’.
    •     In ‘Type’, set Custom TCP Rule.
    •     Protocol should be set to TCP.
    •     Set Port Range to 4000 (the default port used by NoMachine).
    •     In ‘Source’ select Anywhere or Custom IP.

    To add Security group to existing instance – click right mouse button on the correct instance. Select “Networking” -> “Change Security Groups”. Now choose correct group and click “Assign Security Groups” to confirm. Then you’ll be able to connect via NX protocol.

    #20633
    mattroos
    Participant

    Thank you.  I’m fairly new to AWS and didn’t realize I could use the console to do this.  I’m still having trouble however….

    After adding and setting up the security group+rule as you advise, when I try to use the NoMachine app on my local machine to connect, I get a timeout message.  But yet I am able to ssh in to the same machine from a terminal.  Can you advise on how to troubleshoot?  This only disparity from your setup instructions here

    https://www.nomachine.com/accessing-your-remote-linux-desktop-on-amazon-elastic-compute-cloud-via-NoMachine

    and my own configuration (that I’m aware of) is that (1) my instance is Ubuntu 16.04, and (2) I did not go through the “Getting the VM desktop environment ready” part of the linked tutorial.  Is there something akin to that, that I should install for Ubuntu?  I did go through the subsequent tutorial step, installing the NoMachine x86_64 .deb package found here: https://www.nomachine.com/download/linux&id=1 on the instance.

    Thanks.

    #20635
    mattroos
    Participant

    Following up, regarding my Ubuntu 16.04 instance…  I installed the Xfce desktop as described here: https://www.nomachine.com/AR11N00908&an=ssh%20key.  But the same timeout problem remains, when I try to connect using the NoMachine app.

    #20648
    kroy
    Contributor

    It looks there is still problem with Security Groups configuration. Did you tried adding a rule with selected “Custom IP” as “Source”?

    #20657
    mattroos
    Participant

    I initially tried it with “Source” set to “Anywhere”.  I’ve also tried it set to “MyIP”.  In both cases there is a timeout.

    #20666
    Britgirl
    Keymaster

    So you don’t even reach the login prompt (username and password pane)? We’ve gone through the instructions again just to make sure they are correct, which they are. Have you checked whether there IP address has changed? If you are using a previous session file, try creating a new connection from scratch. Does that help?

    #20667
    mattroos
    Participant

    I can still log in with ssh using the same public DNS name as I’m using when trying with NX, so the address cannot have changed.  I’m not sure what you mean by session file.  Can you explain?  Where is this file located?  Thanks.

    #20727
    kroy
    Contributor

    The connection file which is mentioned in this case – stores pre-session settings. The directory defined in the Connections field from the ‘Player environment panel of the GUI’ is by default located in the ~/Documents/NoMachine.

    So in this case it is better to create a new connection. Are you able to see the login prompt? If not, it looks like there is still a problem with the Security Groups configuration. Could it be that the wrong group was assigned?

Viewing 9 posts - 1 through 9 (of 9 total)

Closed because the user did not provide further feedback. Please notify us if you confirm that it is resolved or open a new topic if you have the same problem.