Setup problems: AWS

Interesting…it seems like it was a firewall issue.

Using my cellphone, it worked.

Hi I am a little lost when it comes to setting up AWS. I have been following the video but seems like a lot of things on AWS have changed. I would recommend an update to the video since that would solve a lot of people’s problems in one shot.

My specific problem:
I get up to the point where in cygwin I write the command ‘bash’. I get this error:
: No such file or directory/bash line 4: $’\r’: command not found line 9: syntax error near unexpected token elif' ' line 9:elif [ $region = “eu-west-1” ]; then

Should I be starting the amazon instance manually? I am not sure how to do that… I requested the limit increase which got approved but haven’t done anything on the AWS website manually. Not sure if that is correct.

Hi @tehskhu,

Once it works, the script should start the EC2 instance for you, at which point you can SSH in.

You may be able to resolve your problem by running the dos2unix utility on the script.

I tried this but got similar error:
$ dos2unix
-bash: dos2unix: command not found

Can you be a bit more specific?

You can install it using the Cygwin package manager.

Alternatively, you may be able to remove the carriage returns by executing the following command:

sed -i 's/\r$//'

Let me know if that works out.

I am almost there. Can start the instance. However when I do nvidia-smi I get the error:
nvidia-smi: command not found
How to fix this?

Jupyter notebook runs
There is no message returned when I try to import theanos
import keras says using theano backend so I think this is ok.

Also another question. If I release my elastic IP, will I automatically be assigned a public IP? From my understanding, I just have to make sure I know which IP I get assigned everytime and use that when to connect. Is that correct or are there any other steps involved?

Try rebooting your instance to resolve the nvidia-smi issue.

If you don’t want to use an EIP, make sure that your subnet automatically assigns a public IP to your instance on launch - i.e., the following checkbox should be checked:

Or if you prefer the cli:

aws ec2 modify-subnet-attribute --subnet-id <your-subnet-id> --map-public-ip-on-launch

Note that, as far as I know, a public IP is only assigned at launch - you can’t attach a public IP to a pre-existing EC2 instance (but you could still attach another EIP).

im connecting to my P2 Ec2 instance using ssh and having intermitted connection. (i.e i lose my ssh connection every 30 mins). Was wondering if anyone has had similar problems and how you solved it?


I am trying to run: bash, but encountered the following error:

An error occurred (OptInRequired) when calling the CreateVpc operation: You are not subscribed to this service. Please go to to subscribe.

But I have configured aws using the generated credential. Anyone can help? Many thanks!

could you give me the method with more details?

Can we use the free aws outside of US or Europe? Each time I ran “bash”, it always appears:

Only us-west-2 (Oregon), eu-west-1 (Ireland), and us-east-1 (Virginia) are currently supported

Anyone knows how to resolve this? Thanks a lot!

sorry, I forgot to mention that I’m in Hong Kong:-)

Hi @chenwk891,

At the moment those three regions are the only ones that have p2 instances available.

oh I see! then any method to get free license? Thanks! @z0k

Hi @jeeyung,
What error message are you seeing? What operating system are you using? Please see here for advice on how to ask for help :slight_smile:

The p2 instances are not available for free, unfortunately. But you can try using spot instances to cut down on costs quite dramatically; have a look here and here.

I reinstalled all and tried, but still the same error. Not able to solve anymore. Please help

$ bash line 7: syntax error near unexpected token newline' line 7:

$ bash line 7: syntax error near unexpected token newline' line 7:

Thanks, Zarak! @z0k

1 Like

Hi @Girija,
Did you try what I described in an earlier post?