           # TODO: this special case for koding should be generalized for any group.
           addVm {
             user
+            type    : 'user'
             target  : member
             sudo    : yes
             name    : "koding~#{member.profile.nickname}"

            else
              addVm {
                user
                target  : group
                sudo    : yes
                name    : group.slug

    JGroup  = require './group'
    JUser   = require './user'

    addVm = ({ target, user, name, sudo, groups, type })->

      uid = 0
      groupSlug = if type is 'group' then name else 'koding'
      hostnameAlias = JVM.createAliases {
        nickname : user.username
        type, uid, groupSlug
      }

      vm = new JVM {
        name: name
        users: [
          { id: user.getId(), sudo: yes, owner: yes }
        ]
        groups: groups ? []
        hostnameAlias
      }
      vm.save (err)-> target.addVm vm, handleError

