Is it possible to create an address from a predefined private key? I was not sure how to formulate the question title. What I want to achieve is the same as VanityGen and many other tools do to create an address starting with a predefined part, but with private keys.

So basically I want to create a Bitcoin public/private key pair of which the private key begins with a string I define.

Are there tools that already do this? If not, is it possible? How should it be done theoretically?
You can choose the private key to be whatever you want, and calculate the corresponding public key and bitcoin address.
Adding to this answer, there is really no reason to want to do this. But if one really insisted, here is a way to do it with hal. First start with generating a random private key
$ hal key generate
{
  &quot;raw_private_key&quot;: &quot;7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898&quot;,
  &quot;wif_private_key&quot;: &quot;KzycuDEqJaMyjHWJDD9cdyPeH1rtCTgE5m1EHfCdnTs4ng2D43Bt&quot;,
  &quot;public_key&quot;: &quot;02260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4&quot;,
  &quot;uncompressed_public_key&quot;: &quot;04260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4349d9106ee1724cf51c954e6aec9522febd7fcb46d7248a0ce390810fc0ac6a0&quot;,
  &quot;addresses&quot;: {
    &quot;p2pkh&quot;: &quot;1J6wqBd7QVGt7vGCNfUShoDEwQg2LFTgRR&quot;,
    &quot;p2wpkh&quot;: &quot;bc1qhwvl6yyrtheep7rmsxmf536m45dzfz4wrxdacu&quot;,
    &quot;p2shwpkh&quot;: &quot;3QLdovvKokkyiyX3jTzgfaMCv9MiaoVW5C&quot;
  }
}%                                     

Then change the beginning of the raw private key to deadbeef or whatever you want
7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
-&gt;
deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898

Then get the address for it
$ hal key inspect deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
{
  &quot;raw_private_key&quot;: &quot;deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898&quot;,
  &quot;public_key&quot;: &quot;02de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60&quot;,
  &quot;uncompressed_public_key&quot;: &quot;04de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60b142aa0a4f495e16f80f811ec4556e3d33be28c930fab6e6a051e9a5bdc91d52&quot;,
  &quot;addresses&quot;: {
    &quot;p2pkh&quot;: &quot;1BhftRM4fNZRYdDYMUdujq9C84bRX84Qf8&quot;,
    &quot;p2wpkh&quot;: &quot;bc1qw439kmezxvdff0hnalmeqvfsnttd9gkjux5rct&quot;,
    &quot;p2shwpkh&quot;: &quot;34KVR36eoQrf48bmjQ46JU5dGVg1gqdUFg&quot;
  }
}%