Skip to Main Content

Stata in PVD: Using Stata in Princeton Virtual Desktops (PVD)

Tutorial to use Stata via Princeton Virtual Desktops (PVD)

Using Stata in Princeton Virtual Desktops (PVD)

1. Setting OneDrive

Before using Princeton Virtual Desktops (PVD) you need to set up your Princeton OneDrive. Ignore the step if you already have Princeton OneDrive. OneDrive is a cloud storage from Microsoft where you can access your files from any device. OneDrive will be the main link between your computer and the virtual desktop where Stata is running. OneDrive works like any other folder on your computer.

Steps to set up Princeton OneDrive: 

  • Login into the Princeton University network (with or without VPN) 
  • Open file explorer if you use Windows ('finder' if you use Mac)
  • Search for the OneDrive icon/app
  • Double-click on the icon/app. A window will pop up, follow the prompts to set up OneDrive. In the end, you should see a folder called “OneDrive – Princeton University”. In Windows it will look like this:

  • Once OneDrive is ready, you can copy files to the ‘Documents’ folder to use in Stata (in the virtual machine).
  • If you have problems with OneDrive setup, either consult this page or contact OIT at

2. Accessing Stata

Click on the following link and follow the prompts to log in (if any):

Once you are in, you should see the following:

Click on StataSE 17 -  two windows will pop-up in sequence, the first one looks as follows:

Click on "Allow"

The second one to log in, replace “yourid” with your actual netID:

Click on "Submit"

Once you log in it will take you to the virtual machine running Windows. For Mac users, this may sound strange but yes, you are in Windows environment.

The Stata window will show up, it may take a little while depending on your internet connection speed.

Once it opens, it should look like as follows:


To open Stata files (try not to double-click) …

Go to File Open

Look for the Stata file.

  • Stata data files have extensions *.dta
  • Stata do-files have extensions *.do
  • Stata dictionary files have extensions *.dct


Importing files to Stata …

Go to File Import

Select the type of file and follow the prompts.

  • If importing an Excel file, make sure to check "Import first row as variable names".
  • Before clicking OK, check the "Preview" window to make sure the data is being read correctly.


If you need to change the working directory…

Go to File Change Working Directory

Select the folder where your files are stored. This will ensure that anything you create in Stata will be saved in that folder.

3. Must-knows when using PVD ...

1. If you close the browser, the session will end and you will lose any unsaved work. Make sure to save your work frequently.

2. After 60 minutes of inactivity your PVD session will end. Again, save your work frequently.

3. You can only open one virtual session at a time. If you try to open a second one, the first one will close. Save your work frequently.

4. You cannot print from the PVD to the local printer. You need to access the file from your laptop and print it from there. From the PVD you can print files to PDF, save in OneDrive, open them on your laptop, and print them.

5. If you save files on the desktop or the documents folder in the virtual machine, those files will be deleted 30 days after the final exams for the current semester. Make sure to save your files to the Princeton OneDrive, and have backups in your laptop, Google Drive, and a portable drive.

For more information, please visit:

4. Need more computer power?

If you are working with big files and Stata in PVD is running too slow or not running at all, you have some options:

-  The Data and Statistics Services (DSS) lab has Windows PCs that can handle big datasets. The DSS lab also has a mini-super computer that can run really big datasets. These machines can be accessed in person or remotely. For information on current access, and policies contact DSS at

-  Princeton Research Computing has high-performing computer clusters that can handle really big datasets.

-  See here for instructions on how to access Stata in Adroit: For more information contact Research Computing at

5. Additional information…

You can also access the Princeton Virtual Desktops by remote connection. Visit the following page for detailed instructions.

For further questions regarding access to Princeton Virtual Desktops, contact OIT at

6. Princeton resources to learn Stata

DSS Online Training Section

Princeton DSS Libguides

Data and Statistical Services

Data Consultant

Profile Photo
Muhammad Al Amin
Firestone Library, A-12-F.1

Data Consultant

Profile Photo
Yufei Qin
Firestone Library, A.12F.2

Comments or Questions?

If you have questions or comments about this guide or method, please email