If you don't want Ubuntu to automatically launch or prompt you to start programs when you connect a media device to your PC (external HDD, USB, smartphone,..), the follow the below instructions:
- From Ubuntu's desktop, click on System Settings.
- Go to System >Details.
- Go to Removable Media.
- Tick the Never prompt or start programs on media insertion checkbox.