Instead of using counter, use time in milliseconds from epoch, which will create unique user every time.
Date d = new Date(System.currentTimeMillis());
driver.findElement(By.id("txtUserName")).sendKeys("classroomuser" + d);
For more details, go here