Simulating AR(2) Process With Initial Conditions 
Consider a system process given by $$x_t = -0.9x_{t-2} + w_t, \hspace{2mm} t=1,\dots n$$ where $x_0 \sim N(0,\sigma^2_0), x_{-1} \sim N(0,\sigma_1^2)$, and $w_t$ is Gaussian white noise with variance $\sigma^2_w$.

My question is how can I simulate this series and include $x_0$ and $x_{-1}$? I know how to use the arima.sim function to simulate general AR processes, but I don't know how to include the initial conditions $x_0$ and $x_{-1}$.

Programming the simulation from scratch requires just a few lines of $\textsf{R}$ code:
n <- 500
sigma_sq_minus1 <- 3
sigma_sq_0 <- 2
sigma_sq_w <- 1
  
x_minus1 <- rnorm(1, sd = sqrt(sigma_sq_minus1))
x_0 <- rnorm(1, sd = sqrt(sigma_sq_0))
w <- rnorm(n, sd = sqrt(sigma_sq_w))
x <- c(x_minus1, x_0, rep(NA, n))

for (t in seq_len(n)+2) {
  x[t] <- -0.9 * x[t-2] + w[t-2]
}

plot(x, type = "l")

